結果

問題 No.1083 余りの余り
ユーザー komkompikomkompi
提出日時 2023-11-04 14:07:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,654 ms / 3,000 ms
コード長 412 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 81,836 KB
実行使用メモリ 306,472 KB
最終ジャッジ日時 2023-11-04 14:07:22
合計ジャッジ時間 15,376 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,628 KB
testcase_01 AC 37 ms
53,628 KB
testcase_02 AC 42 ms
59,864 KB
testcase_03 AC 37 ms
53,628 KB
testcase_04 AC 73 ms
62,400 KB
testcase_05 AC 340 ms
126,948 KB
testcase_06 AC 38 ms
53,628 KB
testcase_07 AC 47 ms
62,400 KB
testcase_08 AC 42 ms
59,864 KB
testcase_09 AC 53 ms
53,628 KB
testcase_10 AC 42 ms
59,864 KB
testcase_11 AC 46 ms
62,400 KB
testcase_12 AC 38 ms
53,628 KB
testcase_13 AC 38 ms
53,628 KB
testcase_14 AC 37 ms
53,628 KB
testcase_15 AC 37 ms
53,628 KB
testcase_16 AC 37 ms
53,628 KB
testcase_17 AC 37 ms
53,628 KB
testcase_18 AC 634 ms
186,440 KB
testcase_19 AC 360 ms
126,948 KB
testcase_20 AC 49 ms
62,468 KB
testcase_21 AC 69 ms
74,112 KB
testcase_22 AC 37 ms
53,628 KB
testcase_23 AC 1,526 ms
306,228 KB
testcase_24 AC 2,654 ms
306,400 KB
testcase_25 AC 2,311 ms
305,548 KB
testcase_26 AC 1,554 ms
306,436 KB
testcase_27 AC 42 ms
59,868 KB
testcase_28 AC 1,470 ms
306,468 KB
testcase_29 AC 38 ms
53,632 KB
testcase_30 AC 38 ms
53,632 KB
testcase_31 AC 37 ms
53,632 KB
testcase_32 AC 39 ms
53,632 KB
testcase_33 AC 1,459 ms
306,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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