結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー とりゐ
提出日時 2022-07-21 22:14:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 124 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 98,944 KB
最終ジャッジ日時 2024-07-21 08:01:37
合計ジャッジ時間 3,612 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n,s=map(int,input().split())
ans=[]
while s:
  if s>=n:
    ans.append(n)
    s-=n
  n-=1

print(len(ans))
print(*ans[::-1])
0