QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#380884#8217. King's DinnerOOBMABTRAMS#WA 1ms3568kbC++171.8kb2024-04-07 14:21:582024-04-07 14:21:58

Judging History

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

  • [2024-04-07 14:21:58]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3568kb
  • [2024-04-07 14:21:58]
  • 提交

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+=3)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();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1
2
3

output:

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

result:

ok all tests correct (3 test cases)

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3568kb

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:

wrong answer jury has the better answer: jans = 28, pans = 27 (test case 12)