QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#407267 | #6749. Target | SanCai# | WA | 1ms | 3904kb | C++14 | 991b | 2024-05-08 13:47:31 | 2024-05-08 13:47:31 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define lowbit(x) ((x)&(-x))
#define endl '\n'
#define sc scanf
#define pt printf
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define ls k+k
#define rs k+k+1
using pll = pair<ll, ll>;
using pii = pair<int, int>;
const int N = 2e6 + 10;
ll a[N],b[N],bb[N],ans[N],aa[N];
int n;
ll cal(ll L,ll R)
{
if(L>R)return 0;
ll num=0;
for(int i=n,l=1,r=1;i>=1;i--)
{
while(l<=n&&aa[i]+bb[l]<L)l++;
while(r<=n&&aa[i]+bb[r]<R)r++;
num+=r-l;
}
return num;
}
void UraykevoliQwQ()
{
double a,b;cin>>a>>b;
string ans;
while(abs(a-b)>0.00001)
{
if(ans.size()==50)break;
if(abs(0.5*a-b)>abs(0.5*a+0.5-b))ans.push_back('2'),a=0.5*a+0.5;
else ans.push_back('1'),a=0.5*a;
}
cout<<ans;
}
int main()
{
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
//int _;cin>>_;while(_--)
UraykevoliQwQ();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3700kb
input:
0.5 0.25
output:
1
result:
ok ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
1 0.75
output:
12
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
1 0
output:
11111111111111111
result:
ok ok
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3904kb
input:
0.361954 0.578805
output:
21212121212121212121212121212121212121212121212121
result:
wrong answer wa