結果

問題 No.602 隠されていたゲーム2
ユーザー mkawa2mkawa2
提出日時 2021-11-26 15:09:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 859 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 90,144 KB
最終ジャッジ日時 2023-09-11 22:06:41
合計ジャッジ時間 4,651 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,128 KB
testcase_01 AC 73 ms
71,388 KB
testcase_02 AC 73 ms
71,204 KB
testcase_03 WA -
testcase_04 AC 73 ms
71,484 KB
testcase_05 AC 74 ms
71,224 KB
testcase_06 AC 74 ms
71,388 KB
testcase_07 WA -
testcase_08 AC 73 ms
71,124 KB
testcase_09 AC 74 ms
71,188 KB
testcase_10 AC 73 ms
71,204 KB
testcase_11 AC 74 ms
71,116 KB
testcase_12 AC 74 ms
71,480 KB
testcase_13 AC 74 ms
71,360 KB
testcase_14 AC 75 ms
70,976 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 82 ms
78,260 KB
testcase_18 AC 93 ms
86,292 KB
testcase_19 AC 97 ms
89,860 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 102 ms
90,144 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = 18446744073709551615
inf = 4294967295
md = 10**9+7
# md = 998244353

n = II()
dd = LI()
x, y = LI()
x, y = abs(x+y), abs(x-y)
if x < y: x, y = y, x

if x in dd:
    print(1)
    exit()

mx = max(dd)
for d in dd:
    if x-mx <= d <= x+mx:
        print(2)
        exit()

print(-1)
0