結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-08-12 00:42:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 11,816 KB
実行使用メモリ 21,228 KB
最終ジャッジ日時 2023-10-22 05:32:10
合計ジャッジ時間 5,139 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,096 KB
testcase_01 AC 30 ms
10,096 KB
testcase_02 AC 171 ms
21,228 KB
testcase_03 AC 29 ms
10,096 KB
testcase_04 AC 173 ms
21,228 KB
testcase_05 AC 172 ms
21,228 KB
testcase_06 AC 173 ms
20,964 KB
testcase_07 AC 51 ms
11,792 KB
testcase_08 AC 134 ms
18,156 KB
testcase_09 AC 38 ms
10,752 KB
testcase_10 AC 81 ms
13,964 KB
testcase_11 AC 44 ms
11,112 KB
testcase_12 AC 60 ms
12,456 KB
testcase_13 AC 54 ms
11,928 KB
testcase_14 AC 41 ms
11,076 KB
testcase_15 AC 51 ms
11,792 KB
testcase_16 AC 67 ms
12,984 KB
testcase_17 AC 30 ms
10,140 KB
testcase_18 AC 30 ms
10,132 KB
testcase_19 AC 30 ms
10,112 KB
testcase_20 AC 30 ms
10,176 KB
testcase_21 AC 31 ms
10,152 KB
testcase_22 AC 115 ms
16,380 KB
testcase_23 AC 72 ms
13,512 KB
testcase_24 AC 42 ms
11,016 KB
testcase_25 AC 127 ms
17,700 KB
testcase_26 AC 54 ms
11,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,S = map(int,input().split())

ans = []
for i in range(N,0,-1):
    if S>i:
        ans.append(i)
        S -= i
    else:
        ans.append(S)
        break
ans.reverse()
print(len(ans))
print(*ans)
0