結果

問題 No.602 隠されていたゲーム2
ユーザー daku9640
提出日時 2017-12-02 22:48:35
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,116 KB
最終ジャッジ日時 2024-11-28 03:55:33
合計ジャッジ時間 23,861 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 7 TLE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import combinations
readline = sys.stdin.readline
n = int(readline())
d = sorted(map(int, readline().split()))
x, y = map(int, readline().split())
max_xy = abs(x) + abs(y)
def solve():
    if max_xy in d:
        return 1
    for i in d:
        if max_xy + i in d or max_xy - i in d:
            return 2
    return -1
print(solve())
0