結果

問題 No.355 数当てゲーム(2)
ユーザー kimiyukikimiyuki
提出日時 2017-01-21 00:14:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 515 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 10,816 KB
実行使用メモリ 25,096 KB
平均クエリ数 43.71
最終ジャッジ日時 2023-09-23 12:39:17
合計ジャッジ時間 5,281 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
24,860 KB
testcase_01 AC 45 ms
24,976 KB
testcase_02 AC 43 ms
24,864 KB
testcase_03 AC 44 ms
24,536 KB
testcase_04 AC 43 ms
24,412 KB
testcase_05 AC 45 ms
24,432 KB
testcase_06 AC 44 ms
24,592 KB
testcase_07 AC 44 ms
24,556 KB
testcase_08 AC 44 ms
24,436 KB
testcase_09 AC 43 ms
24,524 KB
testcase_10 AC 44 ms
24,412 KB
testcase_11 AC 43 ms
24,944 KB
testcase_12 AC 45 ms
24,576 KB
testcase_13 AC 46 ms
24,608 KB
testcase_14 AC 43 ms
24,592 KB
testcase_15 AC 43 ms
24,564 KB
testcase_16 AC 43 ms
24,612 KB
testcase_17 AC 46 ms
24,492 KB
testcase_18 AC 43 ms
24,820 KB
testcase_19 AC 44 ms
25,052 KB
testcase_20 AC 45 ms
24,544 KB
testcase_21 AC 44 ms
24,956 KB
testcase_22 AC 44 ms
24,484 KB
testcase_23 AC 43 ms
24,848 KB
testcase_24 AC 43 ms
24,420 KB
testcase_25 AC 44 ms
25,096 KB
testcase_26 AC 43 ms
24,904 KB
testcase_27 AC 43 ms
24,976 KB
testcase_28 AC 44 ms
24,704 KB
testcase_29 AC 43 ms
24,304 KB
testcase_30 AC 42 ms
24,772 KB
testcase_31 AC 44 ms
24,852 KB
testcase_32 AC 45 ms
24,672 KB
testcase_33 AC 46 ms
24,372 KB
testcase_34 AC 44 ms
24,288 KB
testcase_35 AC 41 ms
24,824 KB
testcase_36 AC 44 ms
24,812 KB
testcase_37 AC 45 ms
24,880 KB
testcase_38 AC 43 ms
24,484 KB
testcase_39 AC 44 ms
24,416 KB
testcase_40 AC 45 ms
24,420 KB
testcase_41 AC 44 ms
24,624 KB
testcase_42 AC 44 ms
24,588 KB
testcase_43 AC 44 ms
24,328 KB
testcase_44 AC 45 ms
24,252 KB
testcase_45 AC 44 ms
24,232 KB
testcase_46 AC 44 ms
24,892 KB
testcase_47 AC 43 ms
24,352 KB
testcase_48 AC 45 ms
25,012 KB
testcase_49 AC 44 ms
24,596 KB
testcase_50 AC 43 ms
24,448 KB
testcase_51 AC 45 ms
24,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
import random
import itertools
def query(a, b, c, d):
    print(a, b, c, d)
    sys.stdout.flush()
    x, y = map(int,input().split())
    if x == 4 and y == 0:
        sys.exit(0)
    return x, y
a = { 0, 1, 2, 3 }
x, y = query(*a)
while x + y < 4:
    u = random.choice(list(a))
    v = random.choice(list(set(range(10)) - a))
    b = (a - { u }) | { v }
    nx, ny = query(*b)
    if x + y < nx + ny:
        a, x, y = b, nx, ny
for a in itertools.permutations(a):
    query(*a)
0