結果
問題 |
No.115 遠足のおやつ
|
ユーザー |
![]() |
提出日時 | 2017-07-30 11:33:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 764 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-10 22:30:34 |
合計ジャッジ時間 | 2,617 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 5 WA * 35 |
ソースコード
#picnic N,D,K=(int(i) for i in input().split()) S=1+K S*=K S//=2 if S>D: print(-1) else: i=1 R=[] while D>0 and K>0 and i<=N: if K==1: if D>N: print (-1) else: R.append(D) K-=1 else: M=N+N-K+2 M*=K-1 M//=2 F=D-i-M if i==1: print (-1) K=0 elif F>=0: R.append(F+i) for j in range(K-1): R.append(N-K+j+2) K-=K else: K-=1 R.append(i) D-=i i+=1 T="" for j in range (len(R)): T+=str(R[j])+" " print (T)