QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#383496#6749. Targetqzhfx#WA 0ms3668kbC++23979b2024-04-09 14:53:392024-04-09 14:53:40

Judging History

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

  • [2024-04-09 14:53:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3668kb
  • [2024-04-09 14:53:39]
  • 提交

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