QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#403961#8217. King's Dinneri_am_noob#WA 1ms3692kbC++141.1kb2024-05-02 23:50:062024-05-02 23:50:06

Judging History

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

  • [2024-05-02 23:50:06]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3692kb
  • [2024-05-02 23:50:06]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

using ll=long long;
using pii=pair<int,int>;
#define pb push_back
#define all(a) a.begin(),a.end()
#define sz(a) ((int)a.size())

const int N=105,mod=1000000007;
int add(int x, int y){x+=y; if(x>=mod) x-=mod; return x;}
int sub(int x, int y){x-=y; if(x<0) x+=mod; return x;}
int mul(int x, int y){return 1ll*x*y%mod;}
int Pow(int x, ll y=mod-2){int res=1; for(; y; y>>=1,x=mul(x,x)) if(y&1) res=mul(res,x); return res;}

int n;
char a[N][N];

void ahcorz(){
    cin >> n;
    for(int i=0; i<n; ++i) for(int j=0; j<n; ++j) a[i][j]='.';
    if(n%2==0){
        for(int i=0; i<n; i+=2){
            for(int j=(i/2)&1; j<n; j+=2) a[i][j]=a[i+1][j]='#';
        }
    }
    else if(n>=3){
        for(int i=0; i<n; i+=2) a[0][i]=a[1][i]='#';
        for(int i=3; i<n; i+=2){
            for(int j=(i/2-1)&1; j<n; j+=2) a[i][j]=a[i+1][j]='#';
        }
    }
    for(int i=0; i<n; ++i){
        for(int j=0; j<n; ++j) cout << a[i][j];
        cout << '\n';
    }
}

signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0);
    int t; cin >> t;
    while(t--){
        ahcorz();
    }
}

詳細信息

Test #1:

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

input:

3
1
2
3

output:

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

result:

ok all tests correct (3 test cases)

Test #2:

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

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 grid contains two dominoes that are adjacent (test case 4)