QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#512680#8217. King's DinnerAlex_wcqAC ✓1ms3896kbC++141.2kb2024-08-10 15:21:462024-08-10 15:21:49

Judging History

你现在查看的是最新测评结果

  • [2024-08-10 15:21:49]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3896kb
  • [2024-08-10 15:21:46]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
char f[110][110]; int c[]={0,0,2,4,8,12,16},P[][20][2]={{},{},{{1,1},{1,2}},{{1,1},{1,2},{3,1},{3,2}},{{1,1},{1,2},{1,4},{2,4},{3,1},{4,1},{4,3},{4,4}},{{1,1},{1,2},{1,4},{1,5},{3,1},{3,2},{3,4},{3,5},{5,1},{5,2},{5,4},{5,5}},{{1,1},{1,2},{1,4},{1,6},{2,4},{2,6},{3,1},{3,2},{4,5},{4,6},{5,1},{5,3},{6,1},{6,3},{6,5},{6,6}}};
int main(){
    int T; scanf("%d",&T); 
    while(T--){
        int n; scanf("%d",&n);
        for(int i=1;i<=n;++i) for(int j=1;j<=n;++j) f[i][j]='.';
        for(int i=n;i>=0;i-=6){
            if(i<=6) for(int j=0;j<c[i];++j) f[P[i][j][0]][P[i][j][1]]='#';
            else if(i%2){
		        for(int j=1;j<=i-6;j+=2) f[i-4][j]=f[i-3][j]=f[i-1][j]=f[i][j]='#';
		        for(int j=1;j<=i;j+=2) f[j][i-4]=f[j][i-3]=f[j][i-1]=f[j][i]='#';
	        }
            else{
		        for(int j=1;j<=i-8;j+=2) f[i-4][j]=f[i-3][j]=f[i-1][j]=f[i][j]='#';
		        f[i-4][i-7]=f[i-4][i-6]=f[i-2][i-7]=f[i-2][i-6]=f[i][i-7]=f[i][i-6]='#';
		        for(int j=1;j<=i-2;j+=2) f[j][i-4]=f[j][i-3]=f[j][i-1]=f[j][i]='#';
		        f[i-1][i-4]=f[i][i-4]=f[i-1][i-2]=f[i][i-2]=f[i-1][i]=f[i][i]='#';
	        }
        }
        for(int i=1;i<=n;++i) printf("%s\n",f[i]+1);
    }
    return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3796kb

input:

3
1
2
3

output:

.
##
..
##.
...
##.

result:

ok all tests correct (3 test cases)

Test #2:

score: 0
Accepted
time: 0ms
memory: 3824kb

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: 1ms
memory: 3812kb

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: 1ms
memory: 3896kb

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: 0ms
memory: 3760kb

input:

1
100

output:

##.#.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##
...#................................................................................................
#....##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##.##....

result:

ok all tests correct (1 test case)

Extra Test:

score: 0
Extra Test Passed