結果

問題 No.2806 Cornflake Man
コンテスト
ユーザー anonymously
提出日時 2024-07-12 22:41:21
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 469 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 201 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 96,896 KB
最終ジャッジ日時 2026-03-30 13:17:30
合計ジャッジ時間 7,835 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 13 TLE * 1 -- * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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