QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#308119 | #6652. 着色 | ckiseki# | WA | 19ms | 13596kb | C++20 | 840b | 2024-01-19 16:13:15 | 2024-01-19 16:13:16 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 1024;
int a[N][N];
int main() {
vector<tuple<int, int, int>> e;
for (int i = 0; i < 4; ++i)
e.emplace_back(i, (i + 1) % 4, 0);
e.emplace_back(0, 2, 1);
e.emplace_back(1, 3, 1);
int o = 2;
for (int n = 8; n <= N; n *= 2) {
size_t p = e.size();
for (size_t i = 0; i < p; ++i) {
auto [u, v, c] = e[i];
e.emplace_back(u + n / 2, v + n / 2, c);
}
for (int i = 0; i < n / 2; ++i) {
for (int j = n / 2; j < n; ++j) {
e.emplace_back(i, j, o);
}
}
o += 1;
}
for (auto [u, v, c] : e) {
if (u > v)
swap(u, v);
a[u][v] = c;
}
int n;
cin >> n;
for (int i = 0; i + 1 < n; ++i) {
for (int j = 1; i + j < n; ++j)
cout << a[i][i + j] << ' ';
cout << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 13596kb
input:
2
output:
0
result:
ok Accepted.
Test #2:
score: -100
Wrong Answer
time: 19ms
memory: 13192kb
input:
1000
output:
0 1 0 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 ...
result:
wrong answer Output format error.