QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
1
output:
1 1 4 5 1 4
result:
wrong answer wrong answer