5 条题解

  • -1
    @ 2026-7-19 11:21:21
    
    ```/*#include <algorithm>
    #include <stdio.h>
    #include <bitset>
    #include <string.h>
    #include <math.h>
    #include <cctype>
    #include <cerrno>
    #include <clocale>
    #include <cmath>
    #include <complex>
    #include <cstdio>
    #include <cstdlib>
    #include <cstring>
    #include <ctime>
    #include <deque>
    #include <exception>
    #include <fstream>
    #include <functional>
    #include <limits>
    #include <list>
    #include <map>
    #include <iomanip>
    #include <ios>
    #include <iosfwd>
    #include <iostream>
    #include <istream>
    #include <ostream>
    #include <queue>
    #include <set>
    #include <sstream>
    #include <stack>
    #include <stdexcept>
    #include <streambuf>
    #include <string>
    #include <utility>
    #include <vector>
    #include <cwchar>
    #include <cwctype>
    #include <complex.h>
    #include <fenv.h>
    #include <inttypes.h>
    #include <stdbool.h>
    #include <stdint.h>
    #include <tgmath.h>
    #include <windows.h>
    #include <stdio.h>
    #include <conio.h>
    #include <time.h>
    #include <unistd.h>*/
    #include <bits/stdc++.h>
    using namespace std;
    //放心写吧… 
    char a[2000][3000];
    void f(int n,int x,int y){
    	if(n==1){
    		a[x][y]='/';
    		a[x-1][y+1]='/';
    		a[x][y+1]='_';
    		a[x][y+2]='_';
    		a[x-1][y+2]='\\';
    		a[x][y+3]='\\';
    		return;
    	}
    	f(n-1,x,y);
    	f(n-1,x-pow(2,n-1),y+pow(2,n-1));
    	f(n-1,x,y+pow(2,n));
    } 
    int main(){            
    	int n;
    	cin>>n;
    	memset(a,' ',sizeof(a));
    	f(n,pow(2,n),1);
    	for(int i=1;i<=pow(2,n);i++){
    		for(int j=1;j<=pow(2,n+1);j++)cout<<a[i][j];
    		cout<<"\n";
    	}
    	return 0;
    }

    信息

    ID
    1233
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    173
    已通过
    76
    上传者