QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#806900#9852. Divisionsrotcar07WA 1ms3652kbC++23416b2024-12-09 16:42:092024-12-09 16:42:10

Judging History

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

  • [2024-12-09 16:42:10]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3652kb
  • [2024-12-09 16:42:09]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
constexpr int N=2e5+5;
int main(){
	int x;cin>>x;
	if(x==0) cout<<"8\n1 2 3 3 1 3 3 7\n";else
	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: 1ms
memory: 3588kb

input:

1

output:

6
1 1 4 5 1 4

result:

ok correct

Test #2:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

2

output:

1
1 

result:

ok correct

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3616kb

input:

0

output:

8
1 2 3 3 1 3 3 7

result:

wrong answer wrong answer