結果

問題 No.1083 余りの余り
ユーザー ntudantuda
提出日時 2021-09-12 14:03:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 159 ms / 3,000 ms
コード長 248 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 77,164 KB
最終ジャッジ日時 2023-09-06 08:15:29
合計ジャッジ時間 5,816 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,508 KB
testcase_01 AC 71 ms
71,424 KB
testcase_02 AC 73 ms
71,464 KB
testcase_03 AC 74 ms
71,224 KB
testcase_04 AC 73 ms
71,540 KB
testcase_05 AC 100 ms
76,604 KB
testcase_06 AC 73 ms
71,536 KB
testcase_07 AC 72 ms
71,412 KB
testcase_08 AC 73 ms
71,540 KB
testcase_09 AC 72 ms
71,312 KB
testcase_10 AC 73 ms
71,504 KB
testcase_11 AC 72 ms
71,048 KB
testcase_12 AC 72 ms
71,052 KB
testcase_13 AC 72 ms
71,348 KB
testcase_14 AC 73 ms
71,424 KB
testcase_15 AC 73 ms
71,472 KB
testcase_16 AC 72 ms
71,544 KB
testcase_17 AC 73 ms
71,548 KB
testcase_18 AC 121 ms
76,900 KB
testcase_19 AC 100 ms
77,112 KB
testcase_20 AC 81 ms
76,496 KB
testcase_21 AC 84 ms
76,308 KB
testcase_22 AC 72 ms
71,336 KB
testcase_23 AC 158 ms
77,044 KB
testcase_24 AC 159 ms
76,916 KB
testcase_25 AC 154 ms
76,984 KB
testcase_26 AC 158 ms
77,040 KB
testcase_27 AC 71 ms
71,248 KB
testcase_28 AC 156 ms
76,960 KB
testcase_29 AC 72 ms
71,544 KB
testcase_30 AC 72 ms
71,132 KB
testcase_31 AC 70 ms
71,536 KB
testcase_32 AC 70 ms
71,488 KB
testcase_33 AC 153 ms
77,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
ans = 0
def dfs(k, x):
    global ans
    if x == 0:
        ans = max(ans, k % A[0])
        return
    for i in range(x):
        dfs(k % A[i], i)

dfs(K, N)
print(ans)
0