結果
問題 | No.1083 余りの余り |
ユーザー |
![]() |
提出日時 | 2023-11-04 14:07:06 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,486 ms / 3,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 389 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 306,928 KB |
最終ジャッジ日時 | 2024-09-25 22:02:09 |
合計ジャッジ時間 | 12,581 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
ソースコード
# coding: utf-8# Your code here!import itertoolsN,K=map(int,input().split())A=list(map(int,input().split()))A.sort(reverse=True)patterns = list(itertools.product([0, 1], repeat=N))ans=0for pattern in patterns:"""1のやつは先に"""x=Kfor a,bit in zip(A,pattern):if bit:x%=afor a in A:x%=aans=max(ans,x)print(ans)