結果

問題 No.1083 余りの余り
ユーザー titiatitia
提出日時 2020-06-20 04:57:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 86,540 KB
実行使用メモリ 78,504 KB
最終ジャッジ日時 2023-09-16 16:46:23
合計ジャッジ時間 17,121 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 214 ms
78,212 KB
testcase_01 AC 178 ms
77,696 KB
testcase_02 AC 711 ms
78,088 KB
testcase_03 AC 84 ms
76,544 KB
testcase_04 AC 889 ms
77,940 KB
testcase_05 AC 1,151 ms
77,908 KB
testcase_06 AC 196 ms
78,504 KB
testcase_07 AC 452 ms
77,560 KB
testcase_08 AC 644 ms
77,720 KB
testcase_09 AC 84 ms
76,456 KB
testcase_10 AC 508 ms
78,080 KB
testcase_11 AC 801 ms
77,796 KB
testcase_12 AC 441 ms
77,696 KB
testcase_13 AC 326 ms
77,964 KB
testcase_14 AC 194 ms
78,224 KB
testcase_15 AC 86 ms
76,232 KB
testcase_16 AC 87 ms
76,296 KB
testcase_17 AC 529 ms
78,144 KB
testcase_18 AC 918 ms
78,052 KB
testcase_19 AC 804 ms
77,620 KB
testcase_20 AC 756 ms
78,320 KB
testcase_21 AC 88 ms
76,424 KB
testcase_22 AC 88 ms
76,212 KB
testcase_23 AC 911 ms
77,724 KB
testcase_24 AC 712 ms
77,448 KB
testcase_25 AC 470 ms
78,096 KB
testcase_26 AC 692 ms
77,796 KB
testcase_27 AC 548 ms
77,712 KB
testcase_28 WA -
testcase_29 AC 205 ms
77,904 KB
testcase_30 AC 87 ms
76,136 KB
testcase_31 AC 323 ms
77,944 KB
testcase_32 AC 176 ms
77,696 KB
testcase_33 AC 407 ms
77,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

MIN=min(A)
ANS=K%MIN

for a in A:
    ANS=max(ANS,(K%a)%MIN)

import random

for i in range(10**6):
    T=K
    while T>=MIN:
        T%=A[random.randint(0,N-1)]
    ANS=max(ANS,T)

print(ANS)
0