結果

問題 No.467 隠されていたゲーム
ユーザー rpy3cpprpy3cpp
提出日時 2017-03-26 13:26:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 7,984 KB
最終ジャッジ日時 2023-09-20 10:59:10
合計ジャッジ時間 1,935 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 14 ms
7,896 KB
testcase_02 AC 15 ms
7,840 KB
testcase_03 AC 16 ms
7,776 KB
testcase_04 AC 16 ms
7,840 KB
testcase_05 AC 15 ms
7,860 KB
testcase_06 AC 15 ms
7,788 KB
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 15 ms
7,760 KB
testcase_09 AC 16 ms
7,840 KB
testcase_10 AC 15 ms
7,816 KB
testcase_11 AC 15 ms
7,932 KB
testcase_12 AC 15 ms
7,792 KB
testcase_13 AC 15 ms
7,844 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 16 ms
7,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def read_data():
    n = int(input())
    ds = list(map(int, input().split()))
    x, y = map(int, input().split())
    return n, ds, x, y

def solve(n, ds, x, y):
    max_d = max(ds)
    z = max(abs(x), abs(y))
    if z == 0:
        return 0
    if z in ds:
        return 1
    if z <= 2 * max_d:
        return 2
    s, r = divmod(z - 2 * max_d, max_d)
    if r in ds:
        return s + 1
    else:
        return s + 2

n, ds, x, y = read_data()
print(solve(n, ds, x, y))
0