QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#693667 | #6749. Target | yuhaowei | WA | 0ms | 3520kb | C++14 | 1.1kb | 2024-10-31 16:32:19 | 2024-10-31 16:32:21 |
Judging History
answer
#include<iostream>
#include<vector>
#include<array>
#include<algorithm>
#include<string.h>
#include<cstring>
#include <string>
#include<unordered_map>
#include <set>
#include<numeric>
#include<queue>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
#include<assert.h>
#include<climits>
#include <map>
#include <random>
#include <bitset>
#include <chrono>
#include <limits>
#include<fstream>
using ll = long long;
using i64 = long long;
void solve() {
double a, b;
std::cin >> a >> b;
double s = 0.5;
//(a-1)*s+1>=a
//(a-1)*s>=a-1
//(1-a)*s<=1-a
//s<=1
while (std::abs(a-b)>0.0001) {
if (a > b) {
a = a * s;
std::cout << '1';
}
else {
a = (a - 1.0) * s + 1.0;
std::cout << "2";
}
}
std::cout << "\n";
}
int main() {
std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0);
int t = 1;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3520kb
input:
0.5 0.25
output:
result:
wrong answer wa