QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#407950#6749. TargetAdo1phosaWA 1ms3824kbC++17715b2024-05-09 15:19:262024-05-09 15:19:27

Judging History

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

  • [2024-05-09 15:19:27]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3824kb
  • [2024-05-09 15:19:26]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
#define int long long
#define rep(i, l, r) for(int i = l; i <= (int)r; i ++)
#define debug(a) cout << #a << " = " << a << '\n';
#define debug2(a, b) cout << #a << " = " << a << "  " << #b << " = " << b << '\n';
const int N = 2e5 + 5;

double a, b;
void solve() {
	cin >> a >> b;
	vector<int> ans;
	for(int i = 1; fabs(a - b) > 1e-4 && i <= 50; i ++) {

		if(a < b)
			a = (a + 1) / 2, ans.push_back(2);
		else
			a = a / 2, ans.push_back(1);

	}

	for(auto x : ans) cout << x;
}
main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int _ = 1;
    // cin >> _;
    while(_ --) {
    	solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3700kb

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

score: 0
Accepted
time: 1ms
memory: 3648kb

input:

1 0.75

output:

12

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

1 0

output:

11111111111111

result:

ok ok

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3824kb

input:

0.361954 0.578805

output:

21212121212121212121212121212121212121212121212121

result:

wrong answer wa