結果

問題 No.1083 余りの余り
ユーザー mkawa2mkawa2
提出日時 2021-06-04 15:53:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 36 ms / 3,000 ms
コード長 892 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 17,040 KB
最終ジャッジ日時 2023-08-12 04:20:53
合計ジャッジ時間 2,472 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,960 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 15 ms
7,856 KB
testcase_03 AC 15 ms
7,788 KB
testcase_04 AC 16 ms
7,860 KB
testcase_05 AC 20 ms
10,060 KB
testcase_06 AC 16 ms
7,868 KB
testcase_07 AC 16 ms
7,820 KB
testcase_08 AC 15 ms
7,800 KB
testcase_09 AC 16 ms
7,856 KB
testcase_10 AC 15 ms
7,972 KB
testcase_11 AC 15 ms
7,976 KB
testcase_12 AC 15 ms
7,792 KB
testcase_13 AC 16 ms
7,820 KB
testcase_14 AC 16 ms
7,744 KB
testcase_15 AC 16 ms
7,900 KB
testcase_16 AC 16 ms
7,808 KB
testcase_17 AC 16 ms
7,800 KB
testcase_18 AC 25 ms
12,240 KB
testcase_19 AC 21 ms
10,216 KB
testcase_20 AC 16 ms
8,336 KB
testcase_21 AC 17 ms
8,292 KB
testcase_22 AC 15 ms
7,948 KB
testcase_23 AC 32 ms
16,340 KB
testcase_24 AC 31 ms
16,196 KB
testcase_25 AC 32 ms
16,172 KB
testcase_26 AC 32 ms
16,192 KB
testcase_27 AC 16 ms
7,792 KB
testcase_28 AC 36 ms
17,040 KB
testcase_29 AC 16 ms
7,744 KB
testcase_30 AC 15 ms
7,972 KB
testcase_31 AC 16 ms
7,868 KB
testcase_32 AC 15 ms
7,860 KB
testcase_33 AC 31 ms
16,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 10**16
# md = 998244353
# md = 10**9+7

n, k = LI()
aa = LI()
aa.sort(reverse=True)
dp = [-1]*(1 << n)
now = set()
now.add(k)
nxt=set()
for a in aa:
    now|=nxt
    nxt=set()
    for r in now:nxt.add(r%a)

print(max(nxt))
0