結果
問題 |
No.602 隠されていたゲーム2
|
ユーザー |
![]() |
提出日時 | 2023-12-30 00:53:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 23,560 KB |
最終ジャッジ日時 | 2024-09-27 16:26:33 |
合計ジャッジ時間 | 2,490 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 4 |
ソースコード
N=int(input()) D=sorted(map(int,input().split())) x,y=map(int,input().split()) ODD=0 EVEN=0 for d in D: if d%2==0: EVEN=d else: ODD=d if x==0 and y==0: print(0) exit() Distance=abs(x)+abs(y) if Distance in D: print(1) exit() S=set(D) for d in D: x=Distance-d if x>=0: if (x%2==ODD%2 and x<=ODD) or (x%2==EVEN%2 and x<=EVEN): print(2) exit() else: if -x in S: print(2) exit() print(-1)