結果

問題 No.602 隠されていたゲーム2
ユーザー yumechi
提出日時 2017-12-02 00:19:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 104,576 KB
最終ジャッジ日時 2024-11-28 01:24:50
合計ジャッジ時間 2,554 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 8
権限があれば一括ダウンロードができます

ソースコード

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 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