QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#97728 | #6189. Full Clue Problem | cardinal_city# | AC ✓ | 3ms | 3480kb | C++20 | 1.0kb | 2023-04-18 01:30:51 | 2023-04-18 01:30:54 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void pg(vector<vector<int>> &g, int n) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << g[i][j] << ' ';
}
cout << '\n';
}
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int n; cin >> n;
vector<vector<int>> grid(n+2, vector<int>(n+2)), s1(n+2, vector<int>(n+2)), s2(n+2, vector<int>(n+2));
for (int i = 0; i < n; i++) {
s1[i][i] = s2[i][i] = 1;
if (i == 0 || i == n-1) {
grid[i][i] = 3;
} else {
grid[i][i] = 2;
grid[i-1][i+1] = grid[i+1][i-1] = 1;
}
if (i == n-1) continue;
grid[i+1][i] = grid[i][i+1] = 2;
if (i % 2) {
s1[i+1][i] = 1;
s2[i][i+1] = 1;
} else {
s1[i][i+1] = 1;
s2[i+1][i] = 1;
}
}
pg(grid, n);
cout << '\n';
pg(s1, n);
cout << '\n';
pg(s2, n);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3428kb
input:
5
output:
3 2 1 0 0 2 2 2 1 0 1 2 2 2 1 0 1 2 2 2 0 0 1 2 3 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1
result:
ok ok
Test #2:
score: 0
Accepted
time: 2ms
memory: 3448kb
input:
2
output:
3 2 2 3 1 1 0 1 1 0 1 1
result:
ok ok
Test #3:
score: 0
Accepted
time: 2ms
memory: 3480kb
input:
3
output:
3 2 1 2 2 2 1 2 3 1 1 0 0 1 0 0 1 1 1 0 0 1 1 1 0 0 1
result:
ok ok
Test #4:
score: 0
Accepted
time: 2ms
memory: 3480kb
input:
4
output:
3 2 1 0 2 2 2 1 1 2 2 2 0 1 2 3 1 1 0 0 0 1 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 1 1
result:
ok ok
Test #5:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
10
output:
3 2 1 0 0 0 0 0 0 0 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 1 0 0 0 0 0 0 1 2 2 2 0 0 0 0 0 0 0 1 2 3 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0...
result:
ok ok
Test #6:
score: 0
Accepted
time: 3ms
memory: 3440kb
input:
19
output:
3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 1 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 0 1 2 2 2 1 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 0 1 2 2 2 1 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 0 1 2 2 2 1 0 0 0 0...
result:
ok ok
Test #7:
score: 0
Accepted
time: 0ms
memory: 3360kb
input:
20
output:
3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 1 0 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 0 0 1 2 2 2 1 0 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 0 0 1 2 2 2 1 0 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 0 0 1 2...
result:
ok ok