QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#474908#6749. Targethebaodan77777777WA 0ms3820kbC++14399b2024-07-13 09:10:332024-07-13 09:10:33

Judging History

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

  • [2024-07-13 09:10:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3820kb
  • [2024-07-13 09:10:33]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 2e3+10;

int main (){
	double a,b;
	cin>>a>>b;
	
	int flag = 0 ;
	while(abs(a-b) > 1e-4 && flag <= 50){
			double t1 = a*0.5;
			double t2 = (a-1)*0.5 + 1 ;
			
			if( abs (t1 - b) <= abs(t2 - b)){
				cout<<'1';
				a = t1;
			}else{
				cout<<'2';
				a = t2; 
			}
		
		flag++;
			
		}
		cout<<endl;
	
	
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

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

input:

1 0.75

output:

12

result:

ok ok

Test #3:

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

input:

1 0

output:

11111111111111

result:

ok ok

Test #4:

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

input:

0.361954 0.578805

output:

212121212121212121212121212121212121212121212121212

result:

wrong answer wa