結果

問題 No.1083 余りの余り
コンテスト
ユーザー しもりん
提出日時 2024-10-25 17:27:51
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 584 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 537 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 15,452 KB
最終ジャッジ日時 2026-05-05 19:38:58
合計ジャッジ時間 8,761 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import defaultdict,Counter,deque
from heapq import heappush,heappop,heapify
from bisect import bisect,bisect_left
from itertools import product,permutations,combinations,combinations_with_replacement
from math import gcd
import sys
from functools import lru_cache
if len(sys.argv)==2:sys.stdin=open(sys.argv[1])
input=sys.stdin.readline
sys.setrecursionlimit(10**9)

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
M=1<<N
ans=0
for i in range(M):
	X=K
	j=0
	while i>0:
		if i&1:
			X%=A[-j]
		i>>=1
		j+=1
	X%=A[0]
	if ans<X:
		ans=X
print(ans)
0