結果

問題 No.2027 (1, 2, 3, …, N) 's Subset Sum
ユーザー shobonvipshobonvip
提出日時 2022-08-06 00:15:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 123 bytes
コンパイル時間 965 ms
コンパイル使用メモリ 86,372 KB
実行使用メモリ 99,544 KB
最終ジャッジ日時 2023-10-14 02:35:01
合計ジャッジ時間 5,381 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,136 KB
testcase_01 AC 74 ms
71,120 KB
testcase_02 AC 134 ms
99,544 KB
testcase_03 AC 74 ms
71,176 KB
testcase_04 AC 122 ms
99,332 KB
testcase_05 AC 121 ms
99,352 KB
testcase_06 AC 123 ms
99,408 KB
testcase_07 AC 90 ms
78,424 KB
testcase_08 AC 115 ms
92,584 KB
testcase_09 AC 85 ms
76,196 KB
testcase_10 AC 99 ms
83,632 KB
testcase_11 AC 88 ms
77,104 KB
testcase_12 AC 91 ms
79,504 KB
testcase_13 AC 87 ms
78,660 KB
testcase_14 AC 85 ms
76,496 KB
testcase_15 AC 90 ms
78,144 KB
testcase_16 AC 99 ms
81,768 KB
testcase_17 AC 78 ms
75,300 KB
testcase_18 AC 75 ms
71,172 KB
testcase_19 AC 73 ms
70,948 KB
testcase_20 AC 78 ms
75,244 KB
testcase_21 AC 73 ms
70,956 KB
testcase_22 AC 108 ms
88,912 KB
testcase_23 AC 99 ms
82,836 KB
testcase_24 AC 84 ms
77,016 KB
testcase_25 AC 109 ms
91,896 KB
testcase_26 AC 89 ms
78,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

print(len(v))
print(*v[::-1])
0