QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#410926 | #6749. Target | dqw# | TL | 1ms | 3732kb | C++23 | 3.0kb | 2024-05-14 17:30:58 | 2024-05-14 17:30:58 |
Judging History
answer
// __ __ _ _____ _ _ _____ ______ __
// \ \/ / / \|_ _| | | | | __ \ / __ \ \ /\ / /
// \ / / _ \ | | | | | | | | | | | | \ \ / \ / /
// / \ / ___ \| | | |_| | | |__| | |__| |\ V /\ V /
// /_/\_/_/ \_\_| \___/ |_____/ \___\_\ \_/ \_/ (TM)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
#define int long long
#define iint __int128
#define ll long long
#define ld long double
#define vi vector<int>
#define vvi vector<vi>
#define si set<int>
#define mi multiset<int>
#define pii pair<int, int>
#define vpii vector<pii>
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define qi queue<int>
#define dqi deque<int>
#define pqi priority_queue<int>
#define pqpii priority_queue<pair<int, int>>
#define pqivigi priority_queue<int, vector<int>, greater<int>>
#define pqpiivpiigpii priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>
#define st first
#define nd second
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define mp make_pair
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ub(a, b) upper_bound(all(a), b) - a.begin()
#define lb(a, b) lower_bound(all(a), b) - a.begin()
#define maxe(a) *max_element(all(a))
#define mine(a) *min_element(all(a))
#define maxp(a) max_element(all(a)) - a.begin()
#define minp(a) min_element(all(a)) - a.begin()
#define inf 1000000000000000018LL
#define rep(a, b) for (int a = 0; a < b; a++)
#define per(a, b) for (int a = b - 1; a >= 0; a--)
#define db(a) cout << (#a) << ':' << a << endl
#define ddb(a, b) cout << (#a) << ':' << a << ' ' << (#b) << ':' << b << endl
#define tdb(a, b, c) cout << (#a) << ':' << a << ' ' << (#b) << ':' << b << ' ' << (#c) << ':' << c << endl
#define vdb(a) \
cout << (#a) << ':'; \
for (auto _ : a) \
cout << ' ' << _; \
cout << endl
#define yn(x) cout << (x ? "YES\n" : "NO\n")
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define Yn(x) cout << (x ? "Yes\n" : "No\n")
#define Yes cout << "Yes\n"
#define No cout << "No\n"
#define fastio \
ios::sync_with_stdio(false); \
cin.tie(nullptr); \
cout.tie(nullptr)
#define multiple_testcases \
int testcases = 1; \
cin >> testcases; \
while (testcases--)
using namespace std;
void solve()
{
double a,b;cin>>a>>b;
string ans;
for(int i=1;i<=14;i++)
{
ans+='1';
a*=0.5;
}
while(fabs(a-b)>0.0001)
{
a*=0.5;
if(a+0.24<b)
{
a+=0.5;
ans+='2';
}
else
{
ans+='1';
}
}
cout<<ans;
}
signed main()
{
fastio;
//multiple_testcases
solve();
return 0;
}
// Not all efforts result in success, but giving up is sure to result in failure.
// Powered by Vim 9.1 on Linux
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3732kb
input:
0.5 0.25
output:
1111111111111121
result:
ok ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1 0.75
output:
1111111111111122
result:
ok ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
1 0
output:
11111111111111
result:
ok ok
Test #4:
score: -100
Time Limit Exceeded
input:
0.361954 0.578805