QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#323639 | #8217. King's Dinner | arnold518 | AC ✓ | 6ms | 3892kb | C++17 | 2.0kb | 2024-02-10 06:45:12 | 2024-02-10 06:45:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int TC, N;
char A[10][10][10]={
{},
{
"..",
".."
},
{
"##.",
"...",
"..."
},
{
"##..",
"....",
"##..",
"...."
},
{
"##.#.",
"...#.",
"#....",
"#.##.",
"....."
},
{
"##.##.",
"......",
"##.##.",
"......",
"##.##.",
"......"
},
{
"#.#.##.",
"#.#....",
"....##.",
"##.....",
"...#.#.",
"##.#.#.",
"......."
}
};
char ans[110][110];
int main()
{
scanf("%d", &TC);
while(TC--)
{
scanf("%d", &N);
int t=N%6;
if(t==0) t=6;
for(int i=0; i<=t; i++) for(int j=0; j<=t; j++) ans[i][j]=A[t][i][j];
for(; t<N; t+=6)
{
for(int i=0; i<6; i++) for(int j=0; j<6; j++) ans[t+1+i][t+1+j]=A[5][i][j];
if(t%2==1)
{
for(int i=0; i<6; i++) for(int j=0; j<=t; j++)
{
if(i%3==2 || j%2==1) ans[t+1+i][j]=ans[j][t+1+i]='.';
else ans[t+1+i][j]=ans[j][t+1+i]='#';
}
}
else
{
for(int i=0; i<6; i++) for(int j=0; j<3; j++)
{
if(i%2==1 || j==2) ans[t+1+i][j]=ans[j][t+1+i]='.';
else ans[t+1+i][j]=ans[j][t+1+i]='#';
}
for(int i=0; i<6; i++) for(int j=3; j<=t; j++)
{
if(i%3==2 || j%2==0) ans[t+1+i][j]=ans[j][t+1+i]='.';
else ans[t+1+i][j]=ans[j][t+1+i]='#';
}
}
}
for(int i=0; i<N; i++) { for(int j=0; j<N; j++) printf("%c", ans[i][j]); printf("\n"); }
}
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3816kb
input:
3 1 2 3
output:
. ## .. ##. ... ##.
result:
ok all tests correct (3 test cases)
Test #2:
score: 0
Accepted
time: 2ms
memory: 3892kb
input:
50 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50
output:
. ## .. ##. ... ##. ##.# ...# #... #.## ##.## ..... ##.## ..... ##.## #.#.## #.#... ....## ##.... ...#.# ##.#.# ..##.## ....... #.##.## #...... ..##.## #...... #.##.## ##.#.#.# ...#.#.# ........ ##.##.## ........ ##.##.## ........ ##.##.## ##..##.## ......... ##..##.## ......... #.#.##.## #.#...... ...
result:
ok all tests correct (50 test cases)
Test #3:
score: 0
Accepted
time: 6ms
memory: 3772kb
input:
39 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
output:
##..##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.## ................................................... ##..##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.## ................................................... #.#.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.## #.#........................................
result:
ok all tests correct (39 test cases)
Test #4:
score: 0
Accepted
time: 3ms
memory: 3808kb
input:
11 90 91 92 93 94 95 96 97 98 99 100
output:
#.#.##.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #.#....#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# ....##.................................................................................... ##.....##.##.##.##.##.##.##...
result:
ok all tests correct (11 test cases)
Test #5:
score: 0
Accepted
time: 1ms
memory: 3832kb
input:
1 100
output:
##.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# ...#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.# #....................................................................................................
result:
ok all tests correct (1 test case)
Extra Test:
score: 0
Extra Test Passed