QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#93861 | #6189. Full Clue Problem | whatever# | AC ✓ | 2ms | 3740kb | C++14 | 1.0kb | 2023-04-03 13:57:17 | 2023-04-03 13:57:18 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifdef ALEX_WEI
FILE* IN = freopen("1.in", "r", stdin);
FILE* OUT = freopen("1.out", "w", stdout);
#endif
int n;
cin >> n;
for(int i = 1; i <= n; i++, cout << '\n')
for(int j = 1; j <= n; j++, cout << ' ') {
int d = abs(i + j - n - 1);
if(d == 0) cout << (i == 1 || i == n ? 3 : 2);
else cout << max(0, 3 - d);
}
for(int i = 1; i <= n; i++, cout << '\n')
for(int j = 1; j <= n; j++, cout << ' ') {
int d = abs(i + j - n - 1);
if(d == 0) cout << 1;
else if(d == 1) cout << (i & 1);
else cout << 0;
}
for(int i = 1; i <= n; i++, cout << '\n')
for(int j = 1; j <= n; j++, cout << ' ') {
int d = abs(i + j - n - 1);
if(d == 0) cout << 1;
else if(d == 1) cout << (i & 1 ^ 1);
else cout << 0;
}
cerr << 1e3 * clock() / CLOCKS_PER_SEC << " ms\n";
return 0;
}
/*
g++ F.cpp -o F -std=c++14 -O2 -DALEX_WEI
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3740kb
input:
5
output:
0 0 1 2 3 0 1 2 2 2 1 2 2 2 1 2 2 2 1 0 3 2 1 0 0 0 0 0 1 1 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0
result:
ok ok
Test #2:
score: 0
Accepted
time: 2ms
memory: 3664kb
input:
2
output:
2 3 3 2 1 1 1 0 0 1 1 1
result:
ok ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
3
output:
1 2 3 2 2 2 3 2 1 0 1 1 0 1 0 1 1 0 0 0 1 1 1 1 1 0 0
result:
ok ok
Test #4:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
4
output:
0 1 2 3 1 2 2 2 2 2 2 1 3 2 1 0 0 0 1 1 0 0 1 0 1 1 1 0 1 0 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 1 0 0
result:
ok ok
Test #5:
score: 0
Accepted
time: 2ms
memory: 3608kb
input:
10
output:
0 0 0 0 0 0 0 1 2 3 0 0 0 0 0 0 1 2 2 2 0 0 0 0 0 1 2 2 2 1 0 0 0 0 1 2 2 2 1 0 0 0 0 1 2 2 2 1 0 0 0 0 1 2 2 2 1 0 0 0 0 1 2 2 2 1 0 0 0 0 1 2 2 2 1 0 0 0 0 0 2 2 2 1 0 0 0 0 0 0 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ...
result:
ok ok
Test #6:
score: 0
Accepted
time: 2ms
memory: 3688kb
input:
19
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1...
result:
ok ok
Test #7:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
20
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 0 0 0 0 0...
result:
ok ok