結果
| 問題 |
No.602 隠されていたゲーム2
|
| コンテスト | |
| ユーザー |
okaduki
|
| 提出日時 | 2017-12-02 12:50:10 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 376 bytes |
| コンパイル時間 | 131 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 21,552 KB |
| 最終ジャッジ日時 | 2024-11-28 03:35:17 |
| 合計ジャッジ時間 | 2,252 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 11 |
ソースコード
an=int(input())
xs=[int(x) for x in input().split()]
dx,dy=[int(x) for x in input().split()]
o=-1
e=-1
for x in xs:
if x %2==0: e=max(e,x)
else: o=max(o,x)
dx=abs(dx)
dy=abs(dy)
s=dx+dy
if (s==0): print(0)
elif s%2==1:
if s <= o: print(1)
else:
print(2 if s<=o+e else -1)
else:
if s <= e : print(1)
else : print(2 if s <=max(o+o,e+e) else -1)
okaduki