結果

問題 No.355 数当てゲーム(2)
ユーザー rpy3cpprpy3cpp
提出日時 2016-04-03 01:37:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 726 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 24,584 KB
平均クエリ数 21.54
最終ジャッジ日時 2023-09-23 23:37:52
合計ジャッジ時間 4,488 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
23,836 KB
testcase_01 AC 32 ms
23,844 KB
testcase_02 AC 31 ms
24,464 KB
testcase_03 AC 34 ms
23,948 KB
testcase_04 AC 33 ms
24,004 KB
testcase_05 AC 32 ms
24,008 KB
testcase_06 AC 40 ms
24,156 KB
testcase_07 AC 36 ms
24,412 KB
testcase_08 AC 34 ms
24,500 KB
testcase_09 AC 36 ms
24,156 KB
testcase_10 AC 33 ms
24,012 KB
testcase_11 AC 33 ms
23,776 KB
testcase_12 AC 33 ms
24,316 KB
testcase_13 AC 34 ms
23,952 KB
testcase_14 AC 33 ms
23,996 KB
testcase_15 AC 33 ms
23,860 KB
testcase_16 AC 32 ms
24,276 KB
testcase_17 AC 33 ms
24,584 KB
testcase_18 AC 35 ms
24,072 KB
testcase_19 AC 33 ms
24,572 KB
testcase_20 AC 34 ms
24,032 KB
testcase_21 AC 33 ms
24,160 KB
testcase_22 AC 33 ms
23,976 KB
testcase_23 AC 33 ms
23,976 KB
testcase_24 AC 33 ms
24,408 KB
testcase_25 AC 32 ms
23,984 KB
testcase_26 AC 32 ms
23,836 KB
testcase_27 AC 32 ms
24,300 KB
testcase_28 AC 33 ms
23,900 KB
testcase_29 AC 34 ms
24,376 KB
testcase_30 AC 35 ms
24,036 KB
testcase_31 AC 32 ms
24,264 KB
testcase_32 AC 33 ms
23,820 KB
testcase_33 AC 33 ms
23,880 KB
testcase_34 AC 32 ms
24,200 KB
testcase_35 AC 32 ms
24,352 KB
testcase_36 AC 33 ms
23,956 KB
testcase_37 AC 33 ms
24,320 KB
testcase_38 AC 32 ms
23,848 KB
testcase_39 AC 32 ms
24,300 KB
testcase_40 AC 32 ms
24,020 KB
testcase_41 AC 33 ms
24,000 KB
testcase_42 AC 33 ms
24,092 KB
testcase_43 AC 33 ms
24,112 KB
testcase_44 AC 37 ms
24,156 KB
testcase_45 AC 32 ms
24,008 KB
testcase_46 AC 33 ms
23,980 KB
testcase_47 AC 31 ms
24,496 KB
testcase_48 AC 32 ms
23,948 KB
testcase_49 AC 33 ms
24,112 KB
testcase_50 AC 33 ms
24,440 KB
testcase_51 AC 34 ms
24,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

zs = []

def next_query():
    global zs
    n1, n2, n3 = 3, 4, 5
    for n4 in range(0, 3):
        yield n1, n2, n3, n4
    n1, n2, n3 = 0, 1, 2
    for n4 in range(3, 10):
        yield n1, n2, n3, n4
    z345 = min(zs[0:3])
    z012 = min(zs[3:10])
    z = [0] * 10
    for i in range(0, 3):
        z[i] = zs[i] - z345
    for i in range(3, 10):
        z[i] = zs[i] - z012
    nums = [i for i in range(10) if z[i]]
    for n1, n2, n3, n4 in itertools.permutations(nums):
        yield n1, n2, n3, n4


if __name__ == "__main__":
    for n1, n2, n3, n4 in next_query():
        print(n1, n2, n3, n4)
        x, y = map(int, input().split())
        if x == 4:
            break
        zs.append(x + y)
0