QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#806898#9852. Divisionsrotcar07WA 0ms3632kbC++23371b2024-12-09 16:41:072024-12-09 16:41:10

Judging History

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

  • [2024-12-09 16:41:10]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3632kb
  • [2024-12-09 16:41:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
constexpr int N=2e5+5;
int main(){
	int x;cin>>x;
	if(x==1) cout<<"6\n1 1 4 5 1 4\n";
	else{
		vector<int> v;
		int c=0;
		while(x>1){
			c++;
			for(int i=1;i<=__lg(x);i++) v.push_back(c);
			x-=1<<__lg(x)-1;
		}
		cout<<v.size()<<'\n';reverse(v.begin(),v.end());
		for(int x:v) cout<<x<<' ';cout<<'\n';
	}
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

input:

1

output:

6
1 1 4 5 1 4

result:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

2

output:

1
1 

result:

ok correct

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3588kb

input:

0

output:

0


result:

wrong answer empty sequence found