QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#694339#6749. Targetzxk#TL 0ms3924kbC++17579b2024-10-31 17:44:372024-10-31 17:44:39

Judging History

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

  • [2024-10-31 17:44:39]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3924kb
  • [2024-10-31 17:44:37]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define enter cout<<"enter"<<'\n';

using namespace std;

typedef pair<int, int> PII;
typedef pair<double, int> PDD;
typedef long long LL;

const int inf = 1e18, mod = 1e9 + 7;
double exp1 = 1e-4;

signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	double a, b;
	cin >> a >> b;
	cout << string(30, '1');
	cout << 2;
	a = 0.5;
	while (abs(a-b) > exp1)
	{
		if (a > b)
		{
			a *= 0.5;
			cout << 1;
		}
		else 
		{
			a = a / 2 + 0.5;
			cout << 2;
		}
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3920kb

input:

0.5 0.25

output:

11111111111111111111111111111121

result:

ok ok

Test #2:

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

input:

1 0.75

output:

11111111111111111111111111111122

result:

ok ok

Test #3:

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

input:

1 0

output:

11111111111111111111111111111121111111111111

result:

ok ok

Test #4:

score: -100
Time Limit Exceeded

input:

0.361954 0.578805

output:

111111111111111111111111111111221212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212...

result: