QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#611761#6749. TargetxiaofangerWA 1ms3644kbC++17793b2024-10-04 22:35:172024-10-04 22:35:24

Judging History

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

  • [2024-10-04 22:35:24]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3644kb
  • [2024-10-04 22:35:17]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long

void solve() {
	
	double a , b;
	cin >> a >> b;
	
	vector<int> B(5);
	for(int i = 0 ; i < 5 ; i++){
		cout << 1;
		b *= 2;
		if(b >= 1) B[i] = 1 , b--;
		else B[i] = 0;
	}
	// cout << '\n';
	// for(int i = 0 ; i < 5 ; i++) cout << B[i] << ' ';
	// cout << '\n';
	int cnt = 0;
	for(int i = 4 ; i >= 0 ; i--){
		if(B[i]) cnt++;
		else {
			for(int j = 0 ; j < cnt ; j++) cout << 2;
			for(int j = 0 ; j <= i && cnt ; j++) cout << 1;
			cnt = 0;
		}
	}
	if(cnt){
		for(int j = 0 ; j < cnt ; j++) cout << 2;
	}
	
}

int main(){
	ios::sync_with_stdio(false);
    cin.tie(0);
   	
    int __ = 1;
    //cin >> __;
    
	while(__--){
   		solve();
   	}
    return 0;
}








 

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3644kb

input:

0.5 0.25

output:

1111121

result:

wrong answer wa