結果
| 問題 |
No.355 数当てゲーム(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-23 16:41:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 2,000 ms |
| コード長 | 537 bytes |
| コンパイル時間 | 520 ms |
| コンパイル使用メモリ | 81,344 KB |
| 実行使用メモリ | 69,488 KB |
| 平均クエリ数 | 25.40 |
| 最終ジャッジ日時 | 2024-07-17 03:07:40 |
| 合計ジャッジ時間 | 6,212 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 52 |
ソースコード
import itertools
def ask(q):
print(*q, flush=True)
x, y = map(int, input().split())
if x == 4:
exit()
return x, y
ans = [0] * 10
for i in range(3, 10):
x, y = ask((0, 1, 2, i))
ans[i] = x + y
mi = min(ans[3:10])
lst = []
for i in range(3, 10):
if len(lst) < 3 and ans[i] == mi:
lst.append(i)
in_ = []
for i in range(10):
if i in lst:
continue
x, y = ask(lst + [i])
if x + y > 0:
in_.append(i)
for lst in itertools.permutations(in_):
ask(lst)