結果

問題 No.115 遠足のおやつ
ユーザー takakin
提出日時 2020-05-19 00:46:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-01 22:20:40
合計ジャッジ時間 2,927 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 9 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
import itertools
n,d,k=map(int,input().split())
k-=1
A=[]
cur=0
for i in range(1,n+1):
  if cur+i+(2*n-k+1)*k//2>d and n-i>=k:
    A.append(i)
    k-=1
    cur+=i
  else:
    continue
if len(A)!=k:
  print(-1)
else:
  print(*A)
0