結果

問題 No.355 数当てゲーム(2)
ユーザー しらっ亭しらっ亭
提出日時 2016-04-04 05:50:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 1,102 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 11,064 KB
実行使用メモリ 24,928 KB
平均クエリ数 20.94
最終ジャッジ日時 2023-09-23 23:41:37
合計ジャッジ時間 5,817 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
24,336 KB
testcase_01 AC 43 ms
24,452 KB
testcase_02 AC 41 ms
24,264 KB
testcase_03 AC 43 ms
24,768 KB
testcase_04 AC 44 ms
24,340 KB
testcase_05 AC 44 ms
24,612 KB
testcase_06 AC 42 ms
24,204 KB
testcase_07 AC 44 ms
24,408 KB
testcase_08 AC 40 ms
24,468 KB
testcase_09 AC 39 ms
24,720 KB
testcase_10 AC 37 ms
24,748 KB
testcase_11 AC 41 ms
24,456 KB
testcase_12 AC 41 ms
24,236 KB
testcase_13 AC 42 ms
24,188 KB
testcase_14 AC 42 ms
24,532 KB
testcase_15 AC 42 ms
24,592 KB
testcase_16 AC 43 ms
24,616 KB
testcase_17 AC 41 ms
24,324 KB
testcase_18 AC 42 ms
24,516 KB
testcase_19 AC 41 ms
24,848 KB
testcase_20 AC 41 ms
24,760 KB
testcase_21 AC 40 ms
24,324 KB
testcase_22 AC 41 ms
24,868 KB
testcase_23 AC 40 ms
24,388 KB
testcase_24 AC 40 ms
24,372 KB
testcase_25 AC 42 ms
24,188 KB
testcase_26 AC 41 ms
24,928 KB
testcase_27 AC 41 ms
24,520 KB
testcase_28 AC 40 ms
24,536 KB
testcase_29 AC 41 ms
24,444 KB
testcase_30 AC 40 ms
24,188 KB
testcase_31 AC 42 ms
24,468 KB
testcase_32 AC 40 ms
24,616 KB
testcase_33 AC 42 ms
24,728 KB
testcase_34 AC 41 ms
24,660 KB
testcase_35 AC 40 ms
24,872 KB
testcase_36 AC 44 ms
24,324 KB
testcase_37 AC 41 ms
24,348 KB
testcase_38 AC 42 ms
24,520 KB
testcase_39 AC 40 ms
24,236 KB
testcase_40 AC 40 ms
24,432 KB
testcase_41 AC 41 ms
24,664 KB
testcase_42 AC 41 ms
24,660 KB
testcase_43 AC 43 ms
24,464 KB
testcase_44 AC 41 ms
24,208 KB
testcase_45 AC 40 ms
24,280 KB
testcase_46 AC 41 ms
24,264 KB
testcase_47 AC 42 ms
24,604 KB
testcase_48 AC 41 ms
24,464 KB
testcase_49 AC 41 ms
24,432 KB
testcase_50 AC 41 ms
24,584 KB
testcase_51 AC 40 ms
24,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
from itertools import permutations


def solve():
    m = defaultdict(list)
    for i in range(3, 10):
        print('0 1 2 %d' % i)
        x, y = map(int, input().split())
        if x == 4:
            return
        else:
            m[x + y].append(i)

    for i in range(4, -1, -1):
        if i not in m:
            continue
        v = m[i]
        if i == 4:
            v.extend([0, 1, 2])
        elif i == 1:
            pass
        else:
            l = len(v)
            z = v[:] + m[i - 1][:3 - l]
            t = '%d %d %d ' % (z[0], z[1], z[2])
            for j in range(3):
                print(t + str(j))
                x, y = map(int, input().split())
                if x == 4:
                    return
                elif x + y == l + 1:
                    v.append(j)
                    if len(v) == 4:
                        break
        break

    for t in permutations(v):
        print('%d %d %d %d' % t)
        x, y = map(int, input().split())
        if x == 4:
            return


if __name__ == '__main__':
    solve()
0