結果

問題 No.1083 余りの余り
ユーザー tanon710tanon710
提出日時 2020-06-20 00:44:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 333 ms / 3,000 ms
コード長 251 bytes
コンパイル時間 1,207 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 77,224 KB
最終ジャッジ日時 2023-09-16 16:19:28
合計ジャッジ時間 6,316 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,424 KB
testcase_01 AC 75 ms
71,220 KB
testcase_02 AC 76 ms
71,392 KB
testcase_03 AC 74 ms
71,496 KB
testcase_04 AC 82 ms
76,392 KB
testcase_05 AC 126 ms
76,660 KB
testcase_06 AC 75 ms
71,472 KB
testcase_07 AC 80 ms
75,940 KB
testcase_08 AC 76 ms
71,132 KB
testcase_09 AC 74 ms
71,292 KB
testcase_10 AC 77 ms
71,444 KB
testcase_11 AC 81 ms
76,032 KB
testcase_12 AC 76 ms
71,440 KB
testcase_13 AC 75 ms
71,232 KB
testcase_14 AC 75 ms
71,080 KB
testcase_15 AC 76 ms
71,480 KB
testcase_16 AC 75 ms
71,588 KB
testcase_17 AC 75 ms
71,372 KB
testcase_18 AC 167 ms
76,768 KB
testcase_19 AC 122 ms
76,432 KB
testcase_20 AC 82 ms
76,460 KB
testcase_21 AC 86 ms
76,468 KB
testcase_22 AC 76 ms
71,516 KB
testcase_23 AC 329 ms
77,172 KB
testcase_24 AC 330 ms
77,224 KB
testcase_25 AC 333 ms
77,112 KB
testcase_26 AC 331 ms
77,156 KB
testcase_27 AC 76 ms
71,548 KB
testcase_28 AC 332 ms
76,864 KB
testcase_29 AC 73 ms
71,128 KB
testcase_30 AC 73 ms
71,280 KB
testcase_31 AC 74 ms
71,224 KB
testcase_32 AC 75 ms
71,356 KB
testcase_33 AC 333 ms
76,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
ans=0
for i in range(2**(n-1)):
    tmp=k
    for j in range(n):
        if i&(1<<j):
            tmp%=arr[j]
    tmp%=arr[-1]
    ans=max(ans,tmp)
print(ans)
0