結果

問題 No.1083 余りの余り
ユーザー 双六双六
提出日時 2020-08-02 19:22:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 447 ms / 3,000 ms
コード長 477 bytes
コンパイル時間 768 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 77,704 KB
最終ジャッジ日時 2023-09-26 11:00:51
合計ジャッジ時間 7,956 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,856 KB
testcase_01 AC 89 ms
71,616 KB
testcase_02 AC 95 ms
76,904 KB
testcase_03 AC 87 ms
71,720 KB
testcase_04 AC 99 ms
77,636 KB
testcase_05 AC 175 ms
77,180 KB
testcase_06 AC 89 ms
71,528 KB
testcase_07 AC 99 ms
77,376 KB
testcase_08 AC 99 ms
76,792 KB
testcase_09 AC 93 ms
71,708 KB
testcase_10 AC 99 ms
76,796 KB
testcase_11 AC 100 ms
77,208 KB
testcase_12 AC 91 ms
71,912 KB
testcase_13 AC 91 ms
71,368 KB
testcase_14 AC 92 ms
71,708 KB
testcase_15 AC 91 ms
71,868 KB
testcase_16 AC 90 ms
71,780 KB
testcase_17 AC 91 ms
71,644 KB
testcase_18 AC 268 ms
77,704 KB
testcase_19 AC 179 ms
77,176 KB
testcase_20 AC 99 ms
77,500 KB
testcase_21 AC 114 ms
77,564 KB
testcase_22 AC 94 ms
71,856 KB
testcase_23 AC 446 ms
77,692 KB
testcase_24 AC 440 ms
77,368 KB
testcase_25 AC 435 ms
77,284 KB
testcase_26 AC 442 ms
77,580 KB
testcase_27 AC 95 ms
76,792 KB
testcase_28 AC 444 ms
77,580 KB
testcase_29 AC 92 ms
71,832 KB
testcase_30 AC 89 ms
71,768 KB
testcase_31 AC 93 ms
71,608 KB
testcase_32 AC 90 ms
71,708 KB
testcase_33 AC 447 ms
77,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, K = getlist()
	A = getlist()
	A.sort()
	ans = 0
	for i in range(1 << N):
		val = K
		for j in range(N - 1):
			if ((i >> j) & 1) == 1:
				val %= A[-1 - j]

		val %= A[0]
		ans = max(ans, val)

	print(ans)

if __name__ == '__main__':
	main()
0