結果

問題 No.1083 余りの余り
ユーザー kurimupykurimupy
提出日時 2020-06-19 22:01:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 378 bytes
コンパイル時間 1,163 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 194,420 KB
最終ジャッジ日時 2023-09-16 14:14:34
合計ジャッジ時間 14,518 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,680 KB
testcase_01 AC 70 ms
71,376 KB
testcase_02 AC 86 ms
76,328 KB
testcase_03 AC 70 ms
71,172 KB
testcase_04 AC 94 ms
76,576 KB
testcase_05 AC 1,752 ms
133,172 KB
testcase_06 AC 74 ms
71,224 KB
testcase_07 AC 89 ms
76,500 KB
testcase_08 AC 83 ms
76,580 KB
testcase_09 AC 80 ms
76,232 KB
testcase_10 AC 84 ms
76,576 KB
testcase_11 AC 90 ms
76,344 KB
testcase_12 AC 80 ms
76,548 KB
testcase_13 AC 85 ms
76,576 KB
testcase_14 AC 73 ms
71,448 KB
testcase_15 AC 75 ms
71,084 KB
testcase_16 AC 72 ms
71,248 KB
testcase_17 AC 72 ms
71,164 KB
testcase_18 TLE -
testcase_19 AC 1,727 ms
133,172 KB
testcase_20 AC 101 ms
76,600 KB
testcase_21 AC 234 ms
83,656 KB
testcase_22 AC 70 ms
71,204 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
ans=0
A=list(map(int,input().split()))
dp=[[0 for j in range(N)] for i in range(2**N)]
dp[0]=[K for i in range(N)]
for i in range(1,2**N):
    cnt=0
    P=i
    Q=i
    while Q:
        if Q&1:
            for k in range(N):
                dp[P][cnt]=max(dp[P][cnt],dp[P^2**cnt][k]%A[cnt])
        cnt+=1
        Q>>=1
ans=max(dp[-1])
print(ans)


0