結果

問題 No.355 数当てゲーム(2)
ユーザー n_knuun_knuu
提出日時 2016-04-01 23:09:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,083 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 24,632 KB
平均クエリ数 16.88
最終ジャッジ日時 2023-09-23 09:26:06
合計ジャッジ時間 5,507 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
24,076 KB
testcase_01 AC 40 ms
24,088 KB
testcase_02 AC 41 ms
24,148 KB
testcase_03 AC 39 ms
23,852 KB
testcase_04 AC 39 ms
23,976 KB
testcase_05 AC 39 ms
24,008 KB
testcase_06 AC 38 ms
24,436 KB
testcase_07 AC 38 ms
24,252 KB
testcase_08 AC 40 ms
24,412 KB
testcase_09 WA -
testcase_10 AC 39 ms
24,308 KB
testcase_11 AC 40 ms
24,632 KB
testcase_12 AC 37 ms
24,344 KB
testcase_13 AC 38 ms
24,344 KB
testcase_14 AC 37 ms
24,112 KB
testcase_15 AC 38 ms
24,136 KB
testcase_16 AC 38 ms
23,784 KB
testcase_17 AC 39 ms
23,952 KB
testcase_18 AC 40 ms
24,372 KB
testcase_19 AC 40 ms
23,992 KB
testcase_20 AC 40 ms
24,244 KB
testcase_21 AC 40 ms
24,528 KB
testcase_22 AC 39 ms
23,952 KB
testcase_23 AC 39 ms
24,424 KB
testcase_24 AC 39 ms
23,924 KB
testcase_25 AC 39 ms
24,448 KB
testcase_26 AC 40 ms
23,892 KB
testcase_27 AC 40 ms
23,976 KB
testcase_28 AC 39 ms
23,964 KB
testcase_29 AC 39 ms
24,348 KB
testcase_30 AC 39 ms
23,904 KB
testcase_31 AC 40 ms
24,388 KB
testcase_32 AC 39 ms
23,884 KB
testcase_33 AC 39 ms
23,952 KB
testcase_34 AC 39 ms
23,988 KB
testcase_35 AC 39 ms
24,216 KB
testcase_36 AC 40 ms
23,680 KB
testcase_37 AC 41 ms
24,104 KB
testcase_38 AC 38 ms
23,908 KB
testcase_39 AC 38 ms
23,932 KB
testcase_40 AC 39 ms
23,748 KB
testcase_41 AC 38 ms
24,176 KB
testcase_42 AC 38 ms
23,960 KB
testcase_43 AC 39 ms
23,960 KB
testcase_44 AC 37 ms
23,780 KB
testcase_45 AC 39 ms
23,920 KB
testcase_46 AC 39 ms
23,964 KB
testcase_47 AC 40 ms
23,964 KB
testcase_48 AC 38 ms
24,424 KB
testcase_49 AC 39 ms
23,900 KB
testcase_50 AC 38 ms
24,012 KB
testcase_51 AC 37 ms
24,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_finish(x, y):
    return x == 4
l = list(range(4))
not_in = set(range(4, 10))
a = set(range(10))
assert(len(a & set(l)) == 4)
print(*l)
X, Y = map(int, input().split())
if is_finish(X, Y):
    exit(0)
for i in range(4):
    for n in not_in:
        tmpl = l[:]
        tmpl[i] = n
        assert(len(a & set(tmpl)) == 4)
        print(*tmpl)
        tmpx, tmpy = map(int, input().split())
        if is_finish(tmpx, tmpy):
            exit(0)
        if tmpx > X:
            not_in.remove(n)
            not_in.add(l[i])
            l = tmpl[:]
            X, Y = tmpx, tmpy
            break
        elif tmpx < X:
            break
    else:
        for j in range(i+1, 4):
            tmpl = l[:]
            tmpl[i], tmpl[j] = tmpl[j], tmpl[i]
            assert(len(a & set(tmpl)) == 4)
            print(*tmpl)
            tmpx, tmpy = map(int, input().split())
            if is_finish(tmpx, tmpy):
                exit(0)
            if tmpx > X:
                l = tmpl[:]
                X, Y = tmpx, tmpy
                break
        else:
            assert(0)
0