QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#618893#6749. Targetxiojoy#WA 0ms3944kbC++20512b2024-10-07 11:25:392024-10-07 11:25:39

Judging History

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

  • [2024-10-07 11:25:39]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3944kb
  • [2024-10-07 11:25:39]
  • 提交

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-6) {
        b *= 2;
        if (b >= 1) {
            p[cnt++] = 1;
            b -= 1;
        } else {
            p[cnt++] = 0;
        }
    }
    for(int i = 0; i < 13; ++i){
        cout << "1";
    }
    for(int i = cnt - 1; i >= 0; --i){
        if(p[i] == 1) cout <<"2";
        else cout << "1";
    }
    cout << endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

0.5 0.25

output:

111111111111121

result:

ok ok

Test #2:

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

input:

1 0.75

output:

111111111111122

result:

ok ok

Test #3:

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

input:

1 0

output:

1111111111111

result:

wrong answer wa