結果

問題 No.1083 余りの余り
ユーザー komkompikomkompi
提出日時 2023-11-04 14:05:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 306,508 KB
最終ジャッジ日時 2023-11-04 14:06:06
合計ジャッジ時間 13,876 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,676 KB
testcase_01 AC 39 ms
53,676 KB
testcase_02 AC 47 ms
59,896 KB
testcase_03 AC 37 ms
53,676 KB
testcase_04 AC 48 ms
62,432 KB
testcase_05 WA -
testcase_06 AC 38 ms
53,676 KB
testcase_07 WA -
testcase_08 AC 42 ms
59,896 KB
testcase_09 AC 38 ms
53,676 KB
testcase_10 AC 42 ms
59,896 KB
testcase_11 AC 47 ms
62,432 KB
testcase_12 AC 38 ms
53,676 KB
testcase_13 AC 39 ms
53,676 KB
testcase_14 AC 37 ms
53,676 KB
testcase_15 AC 38 ms
53,676 KB
testcase_16 AC 38 ms
53,676 KB
testcase_17 AC 55 ms
53,676 KB
testcase_18 AC 644 ms
186,476 KB
testcase_19 AC 339 ms
126,980 KB
testcase_20 AC 50 ms
62,500 KB
testcase_21 AC 69 ms
74,144 KB
testcase_22 AC 38 ms
53,676 KB
testcase_23 AC 1,471 ms
306,496 KB
testcase_24 WA -
testcase_25 AC 1,466 ms
306,496 KB
testcase_26 WA -
testcase_27 AC 43 ms
59,900 KB
testcase_28 WA -
testcase_29 AC 37 ms
53,680 KB
testcase_30 AC 37 ms
53,680 KB
testcase_31 AC 37 ms
53,680 KB
testcase_32 AC 57 ms
53,680 KB
testcase_33 AC 1,462 ms
306,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import itertools

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

patterns = list(itertools.product([0, 1], repeat=N))

ans=0
for pattern in patterns:
    """
    1のやつは先に
    """
    x=K
    for a,bit in zip(A,pattern):
        if bit:
            x%=a
        
    for a in A:
        x%=a
        
    ans=max(ans,x)

print(ans)
0