結果
問題 |
No.836 じょうよ
|
ユーザー |
![]() |
提出日時 | 2019-06-14 21:33:35 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 765 bytes |
コンパイル時間 | 1,873 ms |
コンパイル使用メモリ | 159,584 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-11-09 00:29:00 |
合計ジャッジ時間 | 5,394 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 TLE * 1 -- * 19 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vl = vector<ll>; #define rep(i, n) for(ll i = 0;i < n;i++) #define all(i) i.begin(), i.end() template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; } template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll l, r, n; cin >> l >> r >> n; vector<ll> ans(n); int cnt = 0; for(ll i = l; i%n != 0; i++) { ans[i%n]++; cnt++; } for(ll i = r; i%n != n-1; i--) { ans[i%n]++; cnt++; } ll base = (r-l+1-cnt)/n; rep(i, n) { cout << ans[i] + base << endl; } }