結果

問題 No.1083 余りの余り
ユーザー gr1msl3ygr1msl3y
提出日時 2022-05-17 23:15:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 238 ms / 3,000 ms
コード長 264 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 76,980 KB
最終ジャッジ日時 2023-10-14 02:14:24
合計ジャッジ時間 6,458 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,344 KB
testcase_01 AC 72 ms
71,248 KB
testcase_02 AC 72 ms
71,184 KB
testcase_03 AC 73 ms
71,220 KB
testcase_04 AC 83 ms
76,448 KB
testcase_05 AC 116 ms
76,496 KB
testcase_06 AC 74 ms
71,372 KB
testcase_07 AC 79 ms
76,328 KB
testcase_08 AC 74 ms
71,244 KB
testcase_09 AC 72 ms
70,984 KB
testcase_10 AC 73 ms
71,240 KB
testcase_11 AC 79 ms
76,324 KB
testcase_12 AC 71 ms
71,444 KB
testcase_13 AC 74 ms
71,404 KB
testcase_14 AC 72 ms
70,840 KB
testcase_15 AC 75 ms
71,216 KB
testcase_16 AC 74 ms
71,308 KB
testcase_17 AC 71 ms
71,012 KB
testcase_18 AC 156 ms
76,404 KB
testcase_19 AC 118 ms
76,528 KB
testcase_20 AC 81 ms
76,280 KB
testcase_21 AC 83 ms
76,460 KB
testcase_22 AC 72 ms
70,840 KB
testcase_23 AC 236 ms
76,752 KB
testcase_24 AC 238 ms
76,944 KB
testcase_25 AC 238 ms
76,652 KB
testcase_26 AC 238 ms
76,868 KB
testcase_27 AC 72 ms
71,348 KB
testcase_28 AC 237 ms
76,980 KB
testcase_29 AC 72 ms
71,064 KB
testcase_30 AC 72 ms
70,844 KB
testcase_31 AC 73 ms
71,408 KB
testcase_32 AC 73 ms
71,236 KB
testcase_33 AC 235 ms
76,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
x = A[-1]
N -= 1
ans = 0
for i in range(1 << N):
    v = K
    for j in range(N):
        if (i >> j) & 1:
            v %= A[j]
    v %= x
    ans = max(ans, v)

print(ans)
0