QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#114745 | #6189. Full Clue Problem | std_abs# | AC ✓ | 1ms | 3504kb | C++20 | 1.4kb | 2023-06-23 13:46:05 | 2023-06-23 13:46:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
#define sz(a) ((int)a.size())
const int mod = 1e9 + 7, N = 53, M = 200000;
int main() {
ios::sync_with_stdio(false), cin.tie(0);
int n;
cin >> n;
vector <vector <int>> a(n, vector <int> (n));
vector <vector <int>> b(n, vector <int> (n));
vector <vector <int>> c(n, vector <int> (n));
for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) {
int d = abs(i - j);
if (d <= 1) {
a[i][j] = 2;
}
if (d == 2) {
a[i][j] = 1;
}
}
a[0][0] = a[n - 1][n - 1] = 3;
b[0][0] = c[0][0] = 1;
for (int i = 1; i < n; ++i) {
if (i & 1) {
b[i - 1][i] = b[i][i] = 1;
c[i][i - 1] = c[i][i] = 1;
} else {
b[i][i - 1] = b[i][i] = 1;
c[i - 1][i] = c[i][i] = 1;
}
}
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cout << a[i][j] << " \n"[j == n - 1];
}
}
cout << '\n';
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cout << b[i][j] << " \n"[j == n - 1];
}
}
cout << '\n';
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cout << c[i][j] << " \n"[j == n - 1];
}
}
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3500kb
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: 0ms
memory: 3468kb
input:
2
output:
3 2 2 3 1 1 0 1 1 0 1 1
result:
ok ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3448kb
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: 1ms
memory: 3504kb
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: 1ms
memory: 3444kb
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 1 1 1 0 0 0 0...
result:
ok ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3452kb
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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