QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#383969#6749. TargetTeiosama#TL 0ms0kbC++17271b2024-04-09 19:23:072024-04-09 19:23:08

Judging History

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

  • [2024-04-09 19:23:08]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-04-09 19:23:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main()
{
	double a,b;cin>>a>>b;
	while(fabs(a-b)>0.0001)
	{
	if(a>b)
	{
		a=a/2+0.5;
		cout<<"2";
		a/=2;
		cout<<"1";
	}
		else{
			a/=2;
			cout<<"1";
			a=a/2+0.5;
			cout<<"2";
		}
	}
	return 0;
}

詳細信息

Test #1:

score: 0
Time Limit Exceeded

input:

0.5 0.25

output:

212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121...

result: