結果
問題 |
No.115 遠足のおやつ
|
ユーザー |
![]() |
提出日時 | 2020-03-25 23:53:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 467 bytes |
コンパイル時間 | 2,104 ms |
コンパイル使用メモリ | 192,328 KB |
最終ジャッジ日時 | 2025-01-09 10:10:49 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 39 RE * 1 |
ソースコード
#include<bits/stdc++.h> using lint=long long; int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint N,D,K;std::cin>>N>>D>>K; D-=K*(K+1)/2; if(D<0||K*(N-K)<D){ std::cout<<-1<<'\n'; return 0; } lint q=D/(N-K),r=D%(N-K); for(lint i=1;i<=K;i++){ std::cout<<(1<i?" ":"")<<i+(i<=K-q-1?0:i==K-q?r:N-K); } std::cout<<'\n'; }