結果

問題 No.1083 余りの余り
ユーザー chineristACchineristAC
提出日時 2020-06-19 21:57:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 251 ms / 3,000 ms
コード長 246 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,704 KB
実行使用メモリ 77,080 KB
最終ジャッジ日時 2023-09-16 14:06:41
合計ジャッジ時間 5,226 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,232 KB
testcase_01 AC 73 ms
71,336 KB
testcase_02 AC 69 ms
71,284 KB
testcase_03 AC 69 ms
71,124 KB
testcase_04 AC 78 ms
76,312 KB
testcase_05 AC 108 ms
76,452 KB
testcase_06 AC 68 ms
71,104 KB
testcase_07 AC 75 ms
76,184 KB
testcase_08 AC 70 ms
71,292 KB
testcase_09 AC 68 ms
71,192 KB
testcase_10 AC 67 ms
71,232 KB
testcase_11 AC 74 ms
76,524 KB
testcase_12 AC 69 ms
71,044 KB
testcase_13 AC 68 ms
71,088 KB
testcase_14 AC 70 ms
71,208 KB
testcase_15 AC 70 ms
71,196 KB
testcase_16 AC 70 ms
71,248 KB
testcase_17 AC 72 ms
70,996 KB
testcase_18 AC 160 ms
76,360 KB
testcase_19 AC 111 ms
76,156 KB
testcase_20 AC 76 ms
76,492 KB
testcase_21 AC 79 ms
76,448 KB
testcase_22 AC 69 ms
71,268 KB
testcase_23 AC 251 ms
76,852 KB
testcase_24 AC 250 ms
76,768 KB
testcase_25 AC 251 ms
76,756 KB
testcase_26 AC 251 ms
76,548 KB
testcase_27 AC 69 ms
71,132 KB
testcase_28 AC 251 ms
77,080 KB
testcase_29 AC 69 ms
71,336 KB
testcase_30 AC 68 ms
71,332 KB
testcase_31 AC 70 ms
71,252 KB
testcase_32 AC 70 ms
71,168 KB
testcase_33 AC 248 ms
76,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

A.sort()

ans=-1

for i in range(2**(N-1)):
    test=K
    for j in range(N-2,-1,-1):
        if i>>j &1==1:
            test%=A[j+1]
    test%=A[0]
    ans=max(ans,test)

print(ans)
0