QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#729428 | #6652. 着色 | PlentyOfPenalty# | WA | 17ms | 7528kb | C++20 | 883b | 2024-11-09 17:06:13 | 2024-11-09 17:06:13 |
Judging History
answer
#include <bits/stdc++.h>
#define sz(x) ((int)(x).size())
#define all(x) begin(x), end(x)
#ifdef memset0
#define log(...) fprintf(stderr, __VA_ARGS__)
#else
#define endl '\n'
#define log(...) (void(0))
#endif
using namespace std;
using ll = long long;
using lf = long double;
using ull = unsigned long long;
const int N = 1e3 + 9;
int n, g[N][N];
int main() {
#ifdef memset0
freopen("H.in", "r", stdin);
#endif
cin.tie(0)->sync_with_stdio(0);
cin >> n;
for (int i = 0; (1 << i) < n; ++i) {
for (int j = 0; j < n; j += (1 << i + 1)) {
for (int u = j; u < j + (1 << i) && u < n; ++u)
for (int v = j + (1 << i); v < (j + (1 << i + 1)) && v < n; ++v) {
g[u][v] = g[v][u] = i;
}
}
}
for (int i = 0; i < n; ++i)
for (int j = i + 1; j < n; ++j) {
cout << g[i][j] << " \n"[j == n - 1];
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3652kb
input:
2
output:
0
result:
ok Accepted.
Test #2:
score: -100
Wrong Answer
time: 17ms
memory: 7528kb
input:
1000
output:
0 1 1 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.