結果
問題 | No.355 数当てゲーム(2) |
ユーザー |
![]() |
提出日時 | 2016-04-04 05:50:10 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 1,102 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 27,728 KB |
平均クエリ数 | 20.94 |
最終ジャッジ日時 | 2024-07-16 23:31:42 |
合計ジャッジ時間 | 5,298 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 52 |
ソースコード
from collections import defaultdictfrom itertools import permutationsdef 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:returnelse:m[x + y].append(i)for i in range(4, -1, -1):if i not in m:continuev = m[i]if i == 4:v.extend([0, 1, 2])elif i == 1:passelse: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:returnelif x + y == l + 1:v.append(j)if len(v) == 4:breakbreakfor t in permutations(v):print('%d %d %d %d' % t)x, y = map(int, input().split())if x == 4:returnif __name__ == '__main__':solve()