結果

問題 No.1083 余りの余り
ユーザー roarisroaris
提出日時 2020-06-20 01:15:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 319 ms / 3,000 ms
コード長 289 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 87,316 KB
実行使用メモリ 77,216 KB
最終ジャッジ日時 2023-09-16 16:24:37
合計ジャッジ時間 5,789 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,428 KB
testcase_01 AC 67 ms
71,124 KB
testcase_02 AC 69 ms
71,128 KB
testcase_03 AC 68 ms
71,336 KB
testcase_04 AC 75 ms
76,660 KB
testcase_05 AC 117 ms
76,796 KB
testcase_06 AC 70 ms
71,328 KB
testcase_07 AC 74 ms
76,244 KB
testcase_08 AC 71 ms
71,368 KB
testcase_09 AC 69 ms
71,464 KB
testcase_10 AC 70 ms
71,420 KB
testcase_11 AC 75 ms
76,252 KB
testcase_12 AC 68 ms
71,124 KB
testcase_13 AC 66 ms
71,428 KB
testcase_14 AC 67 ms
71,384 KB
testcase_15 AC 67 ms
71,432 KB
testcase_16 AC 67 ms
71,640 KB
testcase_17 AC 70 ms
71,396 KB
testcase_18 AC 161 ms
77,136 KB
testcase_19 AC 116 ms
76,812 KB
testcase_20 AC 77 ms
76,344 KB
testcase_21 AC 82 ms
76,628 KB
testcase_22 AC 69 ms
71,292 KB
testcase_23 AC 310 ms
77,148 KB
testcase_24 AC 316 ms
77,216 KB
testcase_25 AC 315 ms
77,212 KB
testcase_26 AC 318 ms
76,832 KB
testcase_27 AC 69 ms
71,428 KB
testcase_28 AC 310 ms
77,200 KB
testcase_29 AC 68 ms
71,124 KB
testcase_30 AC 69 ms
71,384 KB
testcase_31 AC 70 ms
71,332 KB
testcase_32 AC 70 ms
71,424 KB
testcase_33 AC 319 ms
77,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0

for S in range(1<<N):
    if not (S>>(N-1))&1:
        continue
    
    now = K
    
    for i in range(N):
        if (S>>i)&1:
            now %= A[i]

    ans = max(ans, now)

print(ans)
0