QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#380887#8217. King's Dinnerucup-team1338#AC ✓1ms3724kbC++201.8kb2024-04-07 14:23:202024-04-07 14:23:21

Judging History

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

  • [2024-04-07 14:23:21]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3724kb
  • [2024-04-07 14:23:20]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int N=113;
typedef long long ll;
char ans[N][N];
void solve(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)ans[i][j]='.';
    if(n%6==1){
        for(int i=1;i+1<=n;i+=3)for(int j=1;j<=n;j+=2)ans[i][j]=ans[i+1][j]='#';
        for(int i=1;i+1<=n;i+=3)ans[n][i]=ans[n][i+1]='#';
    }
    if(n%6==5)for(int i=1;i<=n;i+=3)for(int j=1;j<=n;j+=2)ans[i][j]=ans[i+1][j]='#';
    if(n%6==2){
        for(int i=1;i<=n-3;i+=2)for(int j=1;j<=n;j+=3)ans[i][j]=ans[i][j+1]='#';
        for(int j=1;j<=n;j+=2)ans[n-1][j]=ans[n][j]='#';
    }
    if(n%6==3){
        for(int i=1;i<=n-3;i+=3)for(int j=1;j<=n;j+=2)ans[i][j]=ans[i+1][j]='#';
        for(int j=1;j<=n;j+=3)ans[n][j]=ans[n][j+1]=ans[n-2][j]=ans[n-2][j+1]='#';
    }
    if(n%6==0){
        ans[1][1]=ans[1][2]=ans[1][4]=ans[1][6]=ans[2][4]=ans[2][6]=ans[3][1]=ans[3][2]=
                ans[4][5]=ans[4][6]=ans[5][3]=ans[5][1]=ans[6][3]=ans[6][1]=ans[6][5]=ans[6][6]='#';
        for(int i=8;i+1<=n;i+=3)ans[i][1]=ans[i+1][1]=ans[i][3]=ans[i+1][3]='#';
        for(int i=8;i<=n;i+=2)ans[i][5]=ans[i][6]='#';

        for(int i=1;i<=n-3;i+=2)for(int j=8;j+1<=n;j+=3)ans[i][j]=ans[i][j+1]='#';
        for(int j=8;j<=n;j+=2)ans[n-1][j]=ans[n][j]='#';
    }
    if(n%6==4){
        ans[1][1]=ans[1][2]=ans[1][4]=ans[2][4]=ans[3][1]=ans[4][1]=ans[4][3]=ans[4][4]='#';
        for(int i=6;i+1<=n;i+=3)ans[i][1]=ans[i+1][1]='#';
        for(int i=6;i<=n;i+=2)ans[i][3]=ans[i][4]='#';
        for(int i=1;i+1<=n;i+=3)for(int j=6;j<=n;j+=2)ans[i][j]=ans[i+1][j]='#';
        for(int j=6;j<=n;j+=3)ans[n][j]=ans[n][j+1]='#';
    }
    for(int i=1;i<=n;i++,cout<<'\n')for(int j=1;j<=n;j++)cout<<ans[i][j];
}

signed main(){
    ios::sync_with_stdio(false);
    int T=1;
    cin>>T;
    while(T--)solve();
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3596kb

input:

3
1
2
3

output:

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

result:

ok all tests correct (3 test cases)

Test #2:

score: 0
Accepted
time: 1ms
memory: 3660kb

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

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: 3600kb

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: 3664kb

input:

1
100

output:

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

result:

ok all tests correct (1 test case)

Extra Test:

score: 0
Extra Test Passed