結果
問題 | No.602 隠されていたゲーム2 |
ユーザー |
![]() |
提出日時 | 2017-12-03 13:08:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 765 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 21,688 KB |
最終ジャッジ日時 | 2024-11-28 08:58:23 |
合計ジャッジ時間 | 2,444 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 8 |
ソースコード
import sysn = int(input())d_arr = list(map(int, input().split()))d_even = []d_odd = []for d in d_arr:if d % 2 == 0:d_even.append(d)else:d_odd.append(d)x, y = map(lambda n: abs(int(n)), input().split())if x == 0 and y == 0:print(0)sys.exit()for d in d_arr:if d == x + y:print(1)sys.exit()if len(d_even) >= 2:d_even_max = max(d_even)d_even.remove(d_even_max)d_even_second_max = max(d_even)if x + y - d_even_max < d_even_second_max:print(2)sys.exit()if len(d_odd) >= 2:d_odd_max = max(d_odd)d_odd.remove(d_odd_max)d_odd_second_max = max(d_odd)if x + y - d_odd_max < d_odd_second_max:print(2)sys.exit()print(-1)