結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー Kiri8128Kiri8128
提出日時 2022-08-05 22:15:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 158 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 99,868 KB
最終ジャッジ日時 2023-10-13 23:24:00
合計ジャッジ時間 4,676 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,196 KB
testcase_01 AC 69 ms
71,136 KB
testcase_02 AC 123 ms
99,664 KB
testcase_03 AC 69 ms
71,224 KB
testcase_04 AC 119 ms
99,868 KB
testcase_05 AC 118 ms
99,852 KB
testcase_06 AC 119 ms
99,800 KB
testcase_07 AC 87 ms
78,584 KB
testcase_08 AC 111 ms
93,040 KB
testcase_09 AC 85 ms
76,536 KB
testcase_10 AC 96 ms
84,152 KB
testcase_11 AC 86 ms
77,312 KB
testcase_12 AC 88 ms
80,000 KB
testcase_13 AC 87 ms
78,912 KB
testcase_14 AC 84 ms
76,560 KB
testcase_15 AC 86 ms
78,672 KB
testcase_16 AC 97 ms
82,084 KB
testcase_17 AC 76 ms
75,820 KB
testcase_18 AC 72 ms
71,128 KB
testcase_19 AC 74 ms
71,176 KB
testcase_20 AC 77 ms
75,440 KB
testcase_21 AC 74 ms
71,220 KB
testcase_22 AC 104 ms
89,232 KB
testcase_23 AC 93 ms
83,316 KB
testcase_24 AC 84 ms
77,060 KB
testcase_25 AC 108 ms
92,224 KB
testcase_26 AC 85 ms
78,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, S = map(int, input().split())
L = []
for i in range(N, 0, -1):
    l = min(S, i)
    if l:
        L.append(l)
        S -= l
print(len(L))
print(*L[::-1])
0