結果

問題 No.602 隠されていたゲーム2
ユーザー tktk_snsntktk_snsn
提出日時 2022-05-13 17:25:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 20,248 KB
最終ジャッジ日時 2023-09-28 22:02:47
合計ジャッジ時間 2,223 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,752 KB
testcase_01 AC 16 ms
7,820 KB
testcase_02 AC 15 ms
7,752 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 16 ms
7,800 KB
testcase_06 AC 16 ms
7,800 KB
testcase_07 AC 16 ms
7,748 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,908 KB
testcase_10 AC 16 ms
7,736 KB
testcase_11 AC 16 ms
7,796 KB
testcase_12 AC 16 ms
7,764 KB
testcase_13 AC 16 ms
7,936 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 25 ms
11,252 KB
testcase_18 AC 43 ms
16,612 KB
testcase_19 AC 52 ms
18,908 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 49 ms
18,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    D = list(map(int, input().split()))
    x, y = map(int, input().split())
    if (x, y) == (0, 0):
        return 0

    P = abs(x + y)
    Q = abs(x - y)
    if P > Q:
        P, Q = Q, P

    if Q in D:
        return 1

    dmax = max(D)
    if Q <= dmax:
        return 2

    return -1


print(main())
0