QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#411782#6749. Targetxiaodaiyang#WA 0ms3988kbC++141.3kb2024-05-15 19:30:052024-05-15 19:30:06

Judging History

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

  • [2024-05-15 19:30:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3988kb
  • [2024-05-15 19:30:05]
  • 提交

answer

#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <random>
#include <climits>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
 
using namespace std;
 
#define endl '\n'
typedef long long ll;
#define int long long
//typedef __int128_t int128;
typedef pair<int, int> PII;
typedef pair<PII, int> PIII;
const int INF = 0x3f3f3f3f, mod = 998244353;
mt19937 rng(time(0));
#define x first
#define y second
#define lowbit(x) ((x) & -(x))
//#define double long double
const int N = 510;

ll n, m;



void solve() {
    
    double a, b;
    cin >> a >> b;
    for (int i = 1; i <= 50; i ++ ) {
        if (fabs(a - b) <= 1e-4) break;
        if (a <= b) {
            cout << 2;
            a = 0.5 * a + 0.5;
        }
        else {
            cout << 1;
            a = a * 0.5;
        }
    }
    //cout << endl << a << " " << b << endl;
}
 
signed main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//     freopen("input.txt", "r", stdin);
//      freopen("output.txt", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
      
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

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

input:

1 0.75

output:

12

result:

ok ok

Test #3:

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

input:

1 0

output:

11111111111111

result:

ok ok

Test #4:

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

input:

0.361954 0.578805

output:

21212121212121212121212121212121212121212121212121

result:

wrong answer wa