QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#403961 | #8217. King's Dinner | i_am_noob# | WA | 1ms | 3692kb | C++14 | 1.1kb | 2024-05-02 23:50:06 | 2024-05-02 23:50:06 |
Judging History
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();
}
}
Details
Tip: Click on the bar to expand more detailed information
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)