結果
| 問題 |
No.2027 (1, 2, 3, …, N) 's Subset Sum
|
| コンテスト | |
| ユーザー |
lilictaka
|
| 提出日時 | 2022-08-10 12:43:49 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 194 bytes |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 97,864 KB |
| 最終ジャッジ日時 | 2024-09-20 19:30:51 |
| 合計ジャッジ時間 | 7,356 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 1 WA * 24 |
ソースコード
def cum2(n):
return ((1 + n) * n)//2
ans = []
N,S = map(int,input().split())
for i in reversed(range(1,N+1)):
if S >= i:
S -= i
ans.append(i)
print(len(ans))
print(*ans)
lilictaka