QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#363732#7703. Base Hi-Lo Gamelucasrpatten#AC ✓12ms10076kbPython3789b2024-03-24 02:31:162024-03-24 02:31:17

Judging History

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

  • [2024-03-24 02:31:17]
  • 评测
  • 测评结果:AC
  • 用时:12ms
  • 内存:10076kb
  • [2024-03-24 02:31:16]
  • 提交

answer

ch="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
B,N = map(int,input().split())
for _ in range(N):
    d=int(input())
    lo = [0]*d
    hi = [B]*d
    last = ''
    while True:
        mid = [(l+h)//2 for l,h in zip(lo, hi)]
        out = ''.join(ch[i] for i in mid)
        if out == last or any(l >= h for l,h in zip(lo,hi)):
            print("cheater", flush=True)
        else:
            print(out, flush=True)
            last = out
        res = input()
        if res == "correct":
            break
        for i in range(d):
            if res[i] == '=':
                lo[i] = mid[i]
                hi[i] = mid[i]+1
            elif res[i] == '+':
                lo[i] = mid[i]+1
            else:
                hi[i] = mid[i]

详细

Test #1:

score: 100
Accepted
time: 11ms
memory: 9908kb

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: 0
Accepted
time: 0ms
memory: 9904kb

input:

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

output:

J
T
Y
a
b
JJJ
999
E49
C29
B19
A09

result:

ok correct (2 test cases)

Test #3:

score: 0
Accepted
time: 12ms
memory: 9936kb

input:

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

output:

555
288
179
169
cheater
555
258
cheater
55555
88885
98775
cheater
5555
2222
cheater
5555
8888
9999
cheater
5555
cheater

result:

ok correct (6 test cases)

Test #4:

score: 0
Accepted
time: 8ms
memory: 10076kb

input:

62 2
4
====
correct
64
================================================================
correct

output:

VVVV
cheater
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
cheater

result:

ok correct (2 test cases)

Test #5:

score: 0
Accepted
time: 11ms
memory: 9852kb

input:

10 10
2
-=
--
correct
2
-=
--
correct
2
-=
--
correct
2
-=
--
correct
2
-=
--
correct
2
-+
--
=-
=-
correct
2
--
-+
=+
correct
2
--
-+
=+
correct
2
--
-+
=+
correct
2
--
-+
=+
correct

output:

55
25
cheater
55
25
cheater
55
25
cheater
55
25
cheater
55
25
cheater
55
28
17
16
cheater
55
22
14
cheater
55
22
14
cheater
55
22
14
cheater
55
22
14
cheater

result:

ok correct (10 test cases)

Test #6:

score: 0
Accepted
time: 6ms
memory: 10036kb

input:

8 2
2
correct
2
correct

output:

44
44

result:

ok correct (2 test cases)