QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#399392 | #6749. Target | szj | WA | 1ms | 3836kb | C++11 | 1.2kb | 2024-04-26 12:14:33 | 2024-04-26 12:14:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const long double PI = acos(-1);
const ll mod = 998244353;
const int maxn = 1e6 + 7;
const int P = 13331;
ll qgcd(ll a, ll b) {
return b == 0 ? a : qgcd(b, a % b);
}
ll qpow(ll a, ll b) {
ll ans = 1;
while (b) {
if (b & 1)
ans = ans * a % mod;
a = a * a % mod;
b >>= 1;
}
return ans % mod;
}
double a, b;
int x, y;
int d[maxn];
vector<int> v;
int flag;
void dfs(int z) {
if (d[z])
return;
d[z] = 1;
if (z == y) {
for (auto i: v) {
cout << i;
}
flag = 1;
}
if (flag)
return;
if (d[z / 2] == 0 && v.size() < 50) {
v.push_back(1);
dfs(z / 2);
v.pop_back();
}
if (flag == 0 && d[(z - 10000) / 2 + 10000] == 0 && v.size() < 50) {
v.push_back(2);
dfs((z - 10000) / 2 + 10000);
v.pop_back();
}
}
void solve() {
cin >> a >> b;
x = a * 10000;
y = b * 10000;
dfs(x);
}
int main() {
// IOS;
int T = 1;
// cin >> T;
while (T--) {
solve();
}
return 0;
}
/*
*/
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3836kb
input:
0.5 0.25
output:
1
result:
ok ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
1 0.75
output:
12
result:
ok ok
Test #3:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
1 0
output:
11111111111111
result:
ok ok
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3820kb
input:
0.361954 0.578805
output:
result:
wrong answer wa