結果

問題 No.1083 余りの余り
ユーザー mlihua09mlihua09
提出日時 2020-10-28 04:14:52
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 271 ms / 3,000 ms
コード長 349 bytes
コンパイル時間 992 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 77,304 KB
最終ジャッジ日時 2023-09-29 03:32:41
合計ジャッジ時間 6,788 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,292 KB
testcase_01 AC 74 ms
71,116 KB
testcase_02 AC 74 ms
70,828 KB
testcase_03 AC 73 ms
71,092 KB
testcase_04 AC 87 ms
76,316 KB
testcase_05 AC 122 ms
76,932 KB
testcase_06 AC 74 ms
71,340 KB
testcase_07 AC 79 ms
76,812 KB
testcase_08 AC 72 ms
71,232 KB
testcase_09 AC 75 ms
71,288 KB
testcase_10 AC 77 ms
71,280 KB
testcase_11 AC 83 ms
76,488 KB
testcase_12 AC 75 ms
71,476 KB
testcase_13 AC 74 ms
71,284 KB
testcase_14 AC 75 ms
71,192 KB
testcase_15 AC 74 ms
71,388 KB
testcase_16 AC 73 ms
71,068 KB
testcase_17 AC 73 ms
71,424 KB
testcase_18 AC 171 ms
76,976 KB
testcase_19 AC 125 ms
76,840 KB
testcase_20 AC 83 ms
76,564 KB
testcase_21 AC 86 ms
76,768 KB
testcase_22 AC 75 ms
71,172 KB
testcase_23 AC 271 ms
77,304 KB
testcase_24 AC 266 ms
76,984 KB
testcase_25 AC 268 ms
76,956 KB
testcase_26 AC 263 ms
76,892 KB
testcase_27 AC 71 ms
71,344 KB
testcase_28 AC 265 ms
77,148 KB
testcase_29 AC 74 ms
71,364 KB
testcase_30 AC 73 ms
71,496 KB
testcase_31 AC 72 ms
71,176 KB
testcase_32 AC 73 ms
71,180 KB
testcase_33 AC 264 ms
77,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())

A = list(map(int, input().split()))

A.sort(reverse=True)

ans = 0
a = A.pop()

from itertools import product

for Iter in product(range(2), repeat=N - 1):
    
    x = K
    
    for i in range(N - 1):
        
        if Iter[i]:
            x %= A[i]
            
    x %= a
    ans = max(x, ans)
    
print(ans)
0