結果

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

ソースコード

diff #

def main():
    N = int(input())
    D = tuple(map(int, input().split()))
    X, Y = map(int, input().split())

    goal = abs(X) + abs(Y)
    if goal == 0:
        print(0)
    elif goal in D:
        print(1)
    else:
        for i in D:
            n = abs(goal - i)
            if n in D:
                print(2)
                break
        else:
            print(-1)

main()
0