QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#383496 | #6749. Target | qzhfx# | WA | 0ms | 3668kb | C++23 | 979b | 2024-04-09 14:53:39 | 2024-04-09 14:53:40 |
Judging History
answer
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math,no-stack-protector")
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
using namespace std;
using ll = int64_t;
using LL = long long;
using ull = uint64_t;
using i128 = __int128_t;
using u128 = __uint128_t;
using pii = pair<ll, ll>;
const int mod = 998244353;
const int N = 1e6 + 7;
const int maxn = 1e5 + 100;
const double eps = 1e-5;
void solve() {
double a, b;
const double s = 0.5;
cin >> a >> b;
vector<int>ans;
for(int i=0;i<10;i++){
ans.push_back(1);
}
a = 0;
while(1){
if(fabs(a-b)<eps&&ans.size()){
break;
}
if(a>b){
a = a * s;
ans.push_back(1);
}else {
a = (a - 1) * s + 1.0;
ans.push_back(2);
}
}
for(auto x:ans){
cout << x << ' ';
}
cout << '\n';
}
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int _;
_ = 1;
// cin >> _;
while (_--) {
solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3668kb
input:
0.5 0.25
output:
1 1 1 1 1 1 1 1 1 1 2 1
result:
wrong answer wa