結果
問題 |
No.1083 余りの余り
|
ユーザー |
![]() |
提出日時 | 2024-10-25 17:27:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 584 bytes |
コンパイル時間 | 320 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,704 KB |
最終ジャッジ日時 | 2024-10-25 17:28:05 |
合計ジャッジ時間 | 13,507 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 TLE * 2 -- * 10 |
ソースコード
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)