QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#723297#5471. Interactive Number Guessingemuach#WA 1ms3772kbC++14716b2024-11-07 21:44:462024-11-07 21:44:46

Judging History

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

  • [2024-11-07 21:44:46]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3772kb
  • [2024-11-07 21:44:46]
  • 提交

answer

#include<bits/stdc++.h>
#define task ""
#define fi first 
#define sc second
using namespace std;
using ll = long long;

int main() {
    cout << "query 0" << endl;

    int sum_dig;
    cin >> sum_dig;

    ll ans = 0;

    for (int i = 1; i <= 18; ++i) {
        int lo = 0, hi = 10;
        while (hi - lo > 1) {
            int mid = (lo + hi)/2;

            cout << "query " << mid * powl(10, i - 1) << endl;
            
            int sum;
            cin >> sum;

            if (sum_dig < sum)
                lo = mid;
            else
                hi = mid;
        }

        ans = (ans + (10 - hi) * powl(10, i - 1));
    }

    cout << "answer " << ans << endl;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3772kb

input:

6
11
4
12
11
13
5
11
13
14
6
11
13
14
15
11
13
14
15
11
13
14
15

output:

query 0
query 5
query 7
query 6
query 50
query 70
query 80
query 500
query 700
query 800
query 900
query 5000
query 7000
query 8000
query 9000
query 50000
query 70000
query 80000
query 90000
query 500000
query 700000
query 800000
query 900000
query 5e+06

result:

wrong answer format  Expected integer, but "5e+06" found