結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー hir355hir355
提出日時 2022-08-05 21:57:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 151 bytes
コンパイル時間 410 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 98,332 KB
最終ジャッジ日時 2023-10-13 22:43:35
合計ジャッジ時間 4,988 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,312 KB
testcase_01 AC 77 ms
70,848 KB
testcase_02 AC 123 ms
98,220 KB
testcase_03 AC 74 ms
70,876 KB
testcase_04 AC 123 ms
98,032 KB
testcase_05 AC 124 ms
98,084 KB
testcase_06 AC 124 ms
98,332 KB
testcase_07 AC 90 ms
78,352 KB
testcase_08 AC 115 ms
91,836 KB
testcase_09 AC 87 ms
76,224 KB
testcase_10 AC 99 ms
83,344 KB
testcase_11 AC 87 ms
77,084 KB
testcase_12 AC 90 ms
79,528 KB
testcase_13 AC 89 ms
78,744 KB
testcase_14 AC 90 ms
76,704 KB
testcase_15 AC 91 ms
78,360 KB
testcase_16 AC 98 ms
81,784 KB
testcase_17 AC 77 ms
75,456 KB
testcase_18 AC 74 ms
71,084 KB
testcase_19 AC 72 ms
71,276 KB
testcase_20 AC 78 ms
75,340 KB
testcase_21 AC 74 ms
70,876 KB
testcase_22 AC 105 ms
88,352 KB
testcase_23 AC 95 ms
82,340 KB
testcase_24 AC 82 ms
77,092 KB
testcase_25 AC 109 ms
91,320 KB
testcase_26 AC 88 ms
78,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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