結果

問題 No.1083 余りの余り
ユーザー hedwig100hedwig100
提出日時 2020-06-19 21:42:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 85,124 KB
最終ジャッジ日時 2023-09-16 13:45:57
合計ジャッジ時間 9,143 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,184 KB
testcase_01 AC 73 ms
71,104 KB
testcase_02 AC 85 ms
76,320 KB
testcase_03 AC 73 ms
71,184 KB
testcase_04 WA -
testcase_05 AC 221 ms
78,844 KB
testcase_06 AC 73 ms
71,304 KB
testcase_07 AC 79 ms
76,224 KB
testcase_08 AC 80 ms
76,284 KB
testcase_09 AC 73 ms
71,472 KB
testcase_10 AC 79 ms
76,276 KB
testcase_11 WA -
testcase_12 AC 74 ms
71,276 KB
testcase_13 AC 73 ms
71,244 KB
testcase_14 AC 74 ms
71,156 KB
testcase_15 AC 73 ms
71,432 KB
testcase_16 AC 73 ms
71,520 KB
testcase_17 AC 72 ms
71,296 KB
testcase_18 WA -
testcase_19 AC 221 ms
79,156 KB
testcase_20 AC 82 ms
76,280 KB
testcase_21 AC 93 ms
76,308 KB
testcase_22 AC 73 ms
71,276 KB
testcase_23 AC 779 ms
84,972 KB
testcase_24 AC 783 ms
85,124 KB
testcase_25 AC 783 ms
84,992 KB
testcase_26 AC 779 ms
85,004 KB
testcase_27 AC 80 ms
76,324 KB
testcase_28 WA -
testcase_29 AC 73 ms
71,428 KB
testcase_30 AC 73 ms
71,308 KB
testcase_31 AC 73 ms
71,200 KB
testcase_32 AC 73 ms
71,200 KB
testcase_33 AC 776 ms
84,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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

    dp = [0] * (1<<N)
    dp[0] = K
    for s in range(1<<N):
        for i in range(N):
            if ((s<<i)&1) == 0:
                dp[s^(1<<i)] = max(dp[s^(1<<i)],dp[s]%A[i])
    print(dp[-1])
if __name__ == '__main__':
    main()
0