QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#618907#6749. Targetxiojoy#RE 0ms3732kbC++20512b2024-10-07 11:36:102024-10-07 11:36:10

Judging History

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

  • [2024-10-07 11:36:10]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3732kb
  • [2024-10-07 11:36:10]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main() {
    double a, b;
    cin >> a >> b;
    int cnt = 0;
    vector<int> p(30);
    while(b > 1e-8) {
        b *= 2;
        if (b >= 1) {
            p[cnt++] = 1;
            b -= 1;
        } else {
            p[cnt++] = 0;
        }
    }
    for(int i = 0; i < 20; ++i){
        cout << "1";
    }
    for(int i = cnt - 1; i >= 0; --i){
        if(p[i] == 1) cout <<"2";
        else cout << "1";
    }
    cout << endl;
}

详细

Test #1:

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

input:

0.5 0.25

output:

1111111111111111111121

result:

ok ok

Test #2:

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

input:

1 0.75

output:

1111111111111111111122

result:

ok ok

Test #3:

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

input:

1 0

output:

11111111111111111111

result:

ok ok

Test #4:

score: -100
Runtime Error

input:

0.361954 0.578805

output:


result: