QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#876282#7703. Base Hi-Lo GameTeapot#TL 0ms3584kbC++202.2kb2025-01-30 19:36:382025-01-30 19:36:38

Judging History

This is the latest submission verdict.

  • [2025-01-30 19:36:38]
  • Judged
  • Verdict: TL
  • Time: 0ms
  • Memory: 3584kb
  • [2025-01-30 19:36:38]
  • Submitted

answer

/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double ld;
typedef __int128_t ill;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif


vector<pll> g(200);
bool t;

bool ask(string s)
{
    cout << s << endl;
    string a;
    cin >> a;
    if(a == "correct"){
        t = false;
        return 0;
    }
    ll n = sz(s);
    FOR(i,0,n)
    {
        if(a[i] == '=')
        {
            g[i].x = (g[i].x+g[i].y)/2;
            g[i].y = g[i].x;
            continue;
        }
        if(g[i].x >= g[i].y){
            cout << "cheater" << endl;
            t = false;
            return 0;
        }
        if(a[i] == '+')
            g[i].x = (g[i].x + g[i].y)/2+1;
        else
            g[i].y = (g[i].x + g[i].y)/2-1;            
    }
    return 0;
        
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    vector<char> ar;
    FOR(i,0,10)
        ar.pb(i+'0');
    FOR(i,0,26)
        ar.pb(i + 'A');
    FOR(i,0,26)
        ar.pb(i+'a');
    ll b,n,d;
    cin >> b >> n;
    FOR(_,0,n)
    {
        cin >> d;
        FOR(i,0,d){
            g[i].x = 0;
            g[i].y = b;
        }
        t = true;
        while(t)
        {
            string s="";
            FOR(i,0,d)
            {
                ll m = (g[i].x + g[i].y)/2;
                s += ar[m];
            }
            ask(s);
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

55555
22225
02335
12345
555555
228828
236809
246809

result:

ok correct (2 test cases)

Test #2:

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

input:

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

output:

J
T
Y
a
b
JJJ
999
E49
B19
A09

result:

ok correct (2 test cases)

Test #3:

score: -100
Time Limit Exceeded

input:

10 6
3
-++
--+
+-=
correct
3
-=+
-++
correct
5

output:

555
288
069
159
555
258
cheater












































































































































































































































































...

result: