結果

問題 No.602 隠されていたゲーム2
ユーザー wajima_wataru
提出日時 2017-12-03 12:46:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 418 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,664 KB
最終ジャッジ日時 2024-11-28 08:57:29
合計ジャッジ時間 2,461 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

n = int(input())
d_arr = list(map(int, input().split()))
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()

odd = 0
even = 0
for d in d_arr:
    if d % 2 == 0:
        even += 1
    else:
        odd += 1
    if even >= 2 or odd >= 2:
        print(2)
        sys.exit()

print(-1)
0