QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#383969 | #6749. Target | Teiosama# | TL | 0ms | 0kb | C++17 | 271b | 2024-04-09 19:23:07 | 2024-04-09 19:23:08 |
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...