QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#649573#7703. Base Hi-Lo Gameenze114514WA 1ms3964kbC++201.6kb2024-10-18 02:26:382024-10-18 02:26:40

Judging History

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

  • [2024-10-18 02:26:40]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3964kb
  • [2024-10-18 02:26:38]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

#define pb push_back

const ld pi = 3.14159265358979323846;
const ll INF = 1e18;

template<typename T>
T chmax(T a, T b) {
    return a > b ? a : b;
}

template<typename T>
T chmin(T a, T b) {
    return a > b ? b : a;
}

const int N = (int)1e5 + 1, M = N * 2;

void solve(int b) {
    int n;
    cin >> n;

    int t = floor(log(b)) + 2;

    string s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

    vector<int> l(n, 0), r(n, b);

    for(int i = 0; i < t; i++){
        string st = "";
        for(int i = 0; i < n; i++){
            st += s[l[i] + r[i] >> 1];
        }

        cout << st << endl;
        string q;
        cin >> q;
        if(q == "correct"){
            return;
        }

        for(int i = 0; i < n; i++){
            if(q[i] == '+'){
                if(l[i] == r[i]){
                    cout << "cheater" << endl;
                    return;
                }
                l[i] = (l[i] + r[i] >> 1) + 1;
            }
            if(q[i] == '-'){
                if(l[i] == r[i]){
                    cout << "cheater" << endl;
                    return;
                }
                r[i] = (l[i] + r[i] >> 1);
            }
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int b;
    cin >> b;

    int t = 1;
    cin >> t;

    while (t--) {
        solve(b);
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3964kb

input:

10 2
5
----=
-=++=
==-==
correct
6
--++-+
=+-=-+
==-=-=
correct

output:

55555
22225
12445
12345
555555
228828
247819
246809

result:

ok correct (2 test cases)

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3744kb

input:

38 2
1
+
+
+
+
correct
3
---
+-=
--=
--=
--=

output:

J
T
Y
a
b
JJJ
999
E49
C29
B19

result:

wrong answer format  Unexpected end of file - token expected (test case 2)