結果

問題 No.602 隠されていたゲーム2
ユーザー GrayCoderGrayCoder
提出日時 2017-12-02 02:31:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 26,876 KB
最終ジャッジ日時 2024-05-06 00:48:01
合計ジャッジ時間 2,276 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 31 ms
10,496 KB
testcase_05 AC 31 ms
10,496 KB
testcase_06 AC 31 ms
10,624 KB
testcase_07 AC 31 ms
10,624 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 31 ms
10,624 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 30 ms
10,624 KB
testcase_16 AC 39 ms
12,672 KB
testcase_17 AC 48 ms
15,740 KB
testcase_18 AC 80 ms
25,472 KB
testcase_19 AC 92 ms
26,616 KB
testcase_20 AC 83 ms
25,724 KB
testcase_21 AC 81 ms
25,644 KB
testcase_22 WA -
testcase_23 AC 82 ms
26,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    D = set(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:
            if abs(goal - i) in D:
                print(2)
                break
        else:
            print(-1)

main()
0