QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#729492 | #6652. 着色 | PlentyOfPenalty# | AC ✓ | 13ms | 3712kb | C++20 | 749b | 2024-11-09 17:13:18 | 2024-11-09 17:13:20 |
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 get(int k) {
int cnt = 0;
while (k) k >>= 1, cnt++;
return cnt - 1;
}
int lowbit(int x) { return x & -x; }
int main() {
#ifdef memset0
freopen("H.in", "r", stdin);
#endif
cin.tie(0)->sync_with_stdio(0);
cin >> n;
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
cout << get(lowbit(i ^ j));
}
cout << endl;
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3712kb
input:
2
output:
0
result:
ok Accepted.
Test #2:
score: 0
Accepted
time: 13ms
memory: 3656kb
input:
1000
output:
010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020105010201030102010401020103010201070102010301020104010201030102010501020103010201040102010301020106010201030102010401020103010201050102010301020104010201030102010801020103010201040102010301020105010201030102...
result:
ok Accepted.
Test #3:
score: 0
Accepted
time: 13ms
memory: 3644kb
input:
988
output:
010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020105010201030102010401020103010201070102010301020104010201030102010501020103010201040102010301020106010201030102010401020103010201050102010301020104010201030102010801020103010201040102010301020105010201030102...
result:
ok Accepted.
Test #4:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
104
output:
0102010301020104010201030102010501020103010201040102010301020106010201030102010401020103010201050102010 010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020105010201 010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020...
result:
ok Accepted.
Test #5:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
7
output:
010201 01020 0102 010 01 0
result:
ok Accepted.
Test #6:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
59
output:
0102010301020104010201030102010501020103010201040102010301 010201030102010401020103010201050102010301020104010201030 01020103010201040102010301020105010201030102010401020103 0102010301020104010201030102010501020103010201040102010 010201030102010401020103010201050102010301020104010201 010201030102010...
result:
ok Accepted.