結果
| 問題 |
No.1972 Modulo Set
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-10 23:00:11 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 837 bytes |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 13,556 KB |
| 最終ジャッジ日時 | 2024-09-21 06:45:48 |
| 合計ジャッジ時間 | 2,871 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 34 |
ソースコード
import itertools
N, M = map(int,input().split())
Set_N = [int(input()) for _ in range(N)]
subset = []
set_2 = []
not_candidates = []
set_length = []
if len(Set_N) == 1:
print(1)
else:
for i in range(1,N+1):
for j in itertools.combinations(Set_N,i):
subset.append(list(j))
for i in subset:
if len(i) == 1:
pass
else:
for pair in itertools.combinations(i,2):
for k in range(1,len(Set_N)+1):
if M >= sum(pair):
if M % sum(pair) != 0:
set_2.append(i)
elif M < sum(pair):
if sum(pair) % M != 0:
set_2.append(i)
if len(i) == k and (M % sum(pair) == 0 or sum(pair) % M == 0):
not_candidates.append(i)
for i in set_2:
if i not in not_candidates:
set_length.append(len(i))
print(max(set_length))