結果

問題 No.115 遠足のおやつ
ユーザー 双六双六
提出日時 2020-08-26 07:48:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 698 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 71,520 KB
最終ジャッジ日時 2023-08-31 01:00:09
合計ジャッジ時間 5,183 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,520 KB
testcase_01 AC 77 ms
71,256 KB
testcase_02 AC 79 ms
71,084 KB
testcase_03 AC 76 ms
71,344 KB
testcase_04 AC 76 ms
70,956 KB
testcase_05 AC 77 ms
71,388 KB
testcase_06 AC 75 ms
71,376 KB
testcase_07 AC 76 ms
71,380 KB
testcase_08 AC 76 ms
71,344 KB
testcase_09 AC 75 ms
71,380 KB
testcase_10 AC 76 ms
71,228 KB
testcase_11 AC 75 ms
71,128 KB
testcase_12 AC 78 ms
70,952 KB
testcase_13 AC 78 ms
71,384 KB
testcase_14 AC 80 ms
71,228 KB
testcase_15 AC 76 ms
70,952 KB
testcase_16 AC 75 ms
71,344 KB
testcase_17 AC 76 ms
71,284 KB
testcase_18 AC 76 ms
71,296 KB
testcase_19 AC 76 ms
70,952 KB
testcase_20 AC 78 ms
71,284 KB
testcase_21 AC 80 ms
71,236 KB
testcase_22 AC 78 ms
71,356 KB
testcase_23 AC 79 ms
70,956 KB
testcase_24 AC 77 ms
71,292 KB
testcase_25 AC 77 ms
71,312 KB
testcase_26 AC 74 ms
71,084 KB
testcase_27 AC 76 ms
71,512 KB
testcase_28 AC 75 ms
71,288 KB
testcase_29 AC 77 ms
71,080 KB
testcase_30 AC 79 ms
70,952 KB
testcase_31 AC 78 ms
71,332 KB
testcase_32 AC 76 ms
71,256 KB
testcase_33 AC 76 ms
71,296 KB
testcase_34 AC 79 ms
71,276 KB
testcase_35 AC 78 ms
71,424 KB
testcase_36 AC 78 ms
71,312 KB
testcase_37 AC 76 ms
71,520 KB
testcase_38 AC 76 ms
71,080 KB
testcase_39 AC 77 ms
71,080 KB
testcase_40 AC 77 ms
71,344 KB
testcase_41 AC 76 ms
71,244 KB
testcase_42 AC 81 ms
71,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, D, K = getlist()
	if N < K:
		print(-1)
		return

	for i in range(K):
		left = 0
		right = 0
		for j in range(1, K - i):
			left += j
		for j in range(1, i + 1):
			right += N + 1 - j

		total = left + right
		if K - i - 1 < D - total < N + 1 - i:
			ans = []
			for j in range(1, K - i):
				ans.append(j)

			ans.append(D - total)

			for j in range(N + 1 - i, N + 1):
				ans.append(j)

			print(*ans)
			return

	print(-1)

if __name__ == '__main__':
	main()
0