結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー KudeKude
提出日時 2022-08-05 21:24:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 157 bytes
コンパイル時間 843 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 100,012 KB
最終ジャッジ日時 2023-10-13 21:47:00
合計ジャッジ時間 5,496 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,316 KB
testcase_01 AC 73 ms
71,052 KB
testcase_02 AC 122 ms
99,704 KB
testcase_03 AC 73 ms
71,308 KB
testcase_04 AC 122 ms
100,012 KB
testcase_05 AC 122 ms
99,920 KB
testcase_06 AC 123 ms
99,840 KB
testcase_07 AC 89 ms
78,372 KB
testcase_08 AC 113 ms
92,932 KB
testcase_09 AC 86 ms
76,468 KB
testcase_10 AC 100 ms
84,052 KB
testcase_11 AC 87 ms
77,492 KB
testcase_12 AC 90 ms
79,772 KB
testcase_13 AC 93 ms
79,036 KB
testcase_14 AC 85 ms
76,704 KB
testcase_15 AC 90 ms
78,480 KB
testcase_16 AC 97 ms
82,108 KB
testcase_17 AC 80 ms
75,512 KB
testcase_18 AC 78 ms
71,064 KB
testcase_19 AC 75 ms
71,392 KB
testcase_20 AC 80 ms
75,764 KB
testcase_21 AC 76 ms
71,312 KB
testcase_22 AC 108 ms
89,320 KB
testcase_23 AC 99 ms
83,216 KB
testcase_24 AC 87 ms
77,260 KB
testcase_25 AC 114 ms
92,560 KB
testcase_26 AC 92 ms
79,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, s = map(int, input().split())
ans = []
for i in range(n, 0, -1):
    if i <= s:
        ans.append(i)
        s -= i
print(len(ans))
print(*reversed(ans))
0