結果

問題 No.602 隠されていたゲーム2
ユーザー 👑 yumechiyumechi
提出日時 2017-12-02 00:24:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 431 bytes
コンパイル時間 1,229 ms
コンパイル使用メモリ 86,620 KB
実行使用メモリ 101,752 KB
最終ジャッジ日時 2023-08-18 18:28:01
合計ジャッジ時間 3,273 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,332 KB
testcase_01 AC 62 ms
71,164 KB
testcase_02 AC 66 ms
71,068 KB
testcase_03 AC 60 ms
71,072 KB
testcase_04 AC 61 ms
71,252 KB
testcase_05 AC 62 ms
71,068 KB
testcase_06 AC 63 ms
71,284 KB
testcase_07 AC 61 ms
71,344 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 63 ms
71,016 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 62 ms
71,396 KB
testcase_16 AC 91 ms
77,072 KB
testcase_17 AC 79 ms
83,104 KB
testcase_18 AC 102 ms
97,792 KB
testcase_19 AC 108 ms
96,384 KB
testcase_20 AC 101 ms
100,036 KB
testcase_21 AC 101 ms
101,752 KB
testcase_22 WA -
testcase_23 AC 104 ms
96,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    dl = dict(zip([int(i) for i in input().split()], [0]*n))
    x, y = map(int, input().split())
    goal = abs(x) + abs(y)
    
    if goal == 0:
        print(0)
        return

    if goal in dl:
        print(1)
        return

    for d in dl.keys():
        tg = abs(goal - d)
        if tg in dl:
            print(2)
            return
    print(-1)

if __name__=='__main__':
    solve()
0