結果

問題 No.2806 Cornflake Man
ユーザー anonymously
提出日時 2024-07-12 22:40:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 469 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 36,992 KB
最終ジャッジ日時 2024-07-12 22:40:19
合計ジャッジ時間 8,779 ms
ジャッジサーバーID
(参考情報)
judge6 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 6 TLE * 2 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
A = sorted([int(a) for a in input().split()])
B = [not i for i in range(n)]
C = []
for i in range(1, n):
    if A[i] * (n-1) < m:
        print(-1)
        exit(0)
    if not B[i]:
        k = A[i] * 2
        for j in range(i+1, n):
            if A[j] > k:
                print(-1)
                exit(0)
            if A[j] == k:
                B[j] = True
                k += A[i]
        C.append(A[i])
print(len(C))
print(*C)
0