QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#715213#8217. King's Dinnerucup-team5071#WA 1ms3624kbC++201.1kb2024-11-06 10:52:022024-11-06 10:52:04

Judging History

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

  • [2024-11-06 10:52:04]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3624kb
  • [2024-11-06 10:52:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
void Solve(){
    int n;
    cin>>n;
    vector <vector<char>> ans(n+1,vector<char>(n+1));
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            ans[i][j]='.';
    if(n&1){
        for(int i=1;i<=n;i+=2)
            for(int j=1;j+1<=n;j+=3)
                ans[j][i]=ans[j+1][i]='#';
        if(n%3==1){
            for(int i=1;i+1<=n;i+=3)
                ans[n][i]=ans[n][i+1]='#';
        }
    }
    else {
        for(int i=1;i<=n-2;i+=2)
            for(int j=1;j+1<=n;j+=3)
                ans[j][i]=ans[j+1][i]='#';
        for(int j=1;j<=n;j+=2)
            ans[j][n-1]=ans[j][n]='#';
        if(n%3==1){
            for(int i=1;i+1<=n-2;i+=3)
                ans[n][i]=ans[n][i+1]='#';
            ans[n][n]='#',ans[n-1][n-1]='.';
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++)
            cout<<ans[i][j];
        cout<<"\n";
    }
}
int main(){
    ios::sync_with_stdio(false),cin.tie(0);
    int T;
    cin>>T;
    while(T--)Solve();
    return 0;
}

詳細信息

Test #1:

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

input:

3
1
2
3

output:

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

result:

ok all tests correct (3 test cases)

Test #2:

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

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 = 8, pans = 7 (test case 6)