QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#799401 | #9852. Divisions | SGColin | WA | 0ms | 3592kb | C++20 | 455b | 2024-12-05 13:16:43 | 2024-12-05 13:16:44 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
int main() {
int n;
cin >> n;
if (n == 0) {puts("1 3 2 5 4"); return 0;}
if (n == 1) {puts("1 1 4 5 1 4"); return 0;}
--n;
int nw = 0;
per(i, 30, 1) {
int cnt = (1 << i) - 1;
while (n >= cnt) {
n -= cnt; ++nw;
rep(j, 1, i) printf("%d ", nw);
}
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
1
output:
1 1 4 5 1 4
result:
wrong answer wrong answer