結果

問題 No.1083 余りの余り
ユーザー yuly3yuly3
提出日時 2020-07-30 23:05:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 76,900 KB
最終ジャッジ日時 2023-09-18 06:42:32
合計ジャッジ時間 5,858 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,356 KB
testcase_01 AC 73 ms
71,420 KB
testcase_02 AC 74 ms
71,132 KB
testcase_03 AC 74 ms
71,352 KB
testcase_04 AC 85 ms
76,352 KB
testcase_05 AC 119 ms
76,336 KB
testcase_06 WA -
testcase_07 AC 81 ms
76,384 KB
testcase_08 AC 75 ms
71,248 KB
testcase_09 AC 75 ms
71,324 KB
testcase_10 AC 75 ms
71,280 KB
testcase_11 AC 79 ms
76,028 KB
testcase_12 WA -
testcase_13 AC 76 ms
71,384 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 74 ms
71,048 KB
testcase_17 AC 77 ms
71,296 KB
testcase_18 AC 164 ms
76,844 KB
testcase_19 AC 119 ms
76,432 KB
testcase_20 AC 84 ms
76,176 KB
testcase_21 AC 88 ms
76,300 KB
testcase_22 AC 77 ms
71,404 KB
testcase_23 AC 249 ms
76,752 KB
testcase_24 AC 250 ms
76,900 KB
testcase_25 AC 248 ms
76,832 KB
testcase_26 AC 250 ms
76,776 KB
testcase_27 AC 75 ms
71,392 KB
testcase_28 AC 249 ms
76,840 KB
testcase_29 AC 73 ms
71,576 KB
testcase_30 AC 75 ms
71,244 KB
testcase_31 AC 75 ms
71,284 KB
testcase_32 AC 75 ms
71,448 KB
testcase_33 AC 251 ms
76,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N, K = map(int, rl().split())
    A = list(map(int, rl().split()))
    
    A.sort(reverse=True)
    ans = 0
    for s in range(1, 1 << (N - 1)):
        mod = K
        for i in range(N - 1):
            if s >> i & 1:
                mod %= A[i]
        mod %= A[-1]
        ans = max(ans, mod)
    print(ans)


if __name__ == '__main__':
    solve()
0