結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー ニックネームニックネーム
提出日時 2022-08-05 21:24:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 142 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 19,324 KB
最終ジャッジ日時 2023-10-13 21:47:10
合計ジャッジ時間 4,155 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 15 ms
7,772 KB
testcase_02 AC 214 ms
19,324 KB
testcase_03 AC 15 ms
7,856 KB
testcase_04 AC 214 ms
19,132 KB
testcase_05 AC 210 ms
19,176 KB
testcase_06 AC 212 ms
18,912 KB
testcase_07 AC 44 ms
9,524 KB
testcase_08 AC 159 ms
16,060 KB
testcase_09 AC 26 ms
8,912 KB
testcase_10 AC 84 ms
12,008 KB
testcase_11 AC 35 ms
9,096 KB
testcase_12 AC 58 ms
10,592 KB
testcase_13 AC 48 ms
10,000 KB
testcase_14 AC 31 ms
9,148 KB
testcase_15 AC 43 ms
9,616 KB
testcase_16 AC 66 ms
10,964 KB
testcase_17 AC 15 ms
7,820 KB
testcase_18 AC 16 ms
7,848 KB
testcase_19 AC 15 ms
7,912 KB
testcase_20 AC 16 ms
7,760 KB
testcase_21 AC 15 ms
7,820 KB
testcase_22 AC 125 ms
14,500 KB
testcase_23 AC 75 ms
11,348 KB
testcase_24 AC 32 ms
9,224 KB
testcase_25 AC 145 ms
15,736 KB
testcase_26 AC 46 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, s = map(int, input().split())
ans = []
while s:
    m = min(n, s)
    n -= 1
    s -= m
    ans.append(m)
print(len(ans))
print(*ans[::-1])
0