Submission #79900


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include<bits/stdc++.h>
using namespace std;
vector<vector<char>>s(2000,vector<char>(2000,'.'));
int t[20];
void f(int x,int y,int n){
if(n==1){
s[x][y]=s[x+2][y]=s[x][y+2]=s[x+2][y+2]='+';
s[x+1][y]=s[x+1][y+2]='|';
s[x][y+1]=s[x+2][y+1]='-';
s[x+1][y+1]='.';
}else{
f(x,y,n-1);
f(x+t[n-1],y,n-1);
f(x+t[n-1]*2,y,n-1);
f(x,y+t[n-1],n-1);
f(x+t[n-1]*2,y+t[n-1],n-1);
f(x,y+t[n-1]*2,n-1);
f(x+t[n-1],y+t[n-1]*2,n-1);
f(x+t[n-1]*2,y+t[n-1]*2,n-1);
}
}
main(){
//ofstream fcout("./kariout.txt");
t[1]=3;
for(int i=2;i<20;i++){
t[i]=t[i-1]*3;
}
int n;cin>>n;
f(0,0,n);
for(int i=0;i<t[n];i++){
for(int j=0;j<t[n];j++){
cout<<s[i][j];
}
cout<<"\n";
}
}

ステータス

項目 データ
問題 1799 - Tile graphic
ユーザー名 ei2326
投稿日時 2024-07-16 12:25:57
言語 C++17
状態 Accepted
得点 620
ソースコード長 866 Byte
最大実行時間 34 ms
最大メモリ使用量 5100 KB

セット

セット 得点 Cases
1 ALL 620 / 620 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
1.txt AC 27 ms 4572 KB
1
2.txt AC 19 ms 4396 KB
1
3.txt AC 18 ms 4476 KB
1
4.txt AC 22 ms 4428 KB
1
5.txt AC 26 ms 4636 KB
1
6.txt AC 34 ms 5100 KB
1