QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#799401#9852. DivisionsSGColinWA 0ms3592kbC++20455b2024-12-05 13:16:432024-12-05 13:16:44

Judging History

你现在查看的是最新测评结果

  • [2024-12-05 13:16:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2024-12-05 13:16:43]
  • 提交

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