結果
問題 |
No.836 じょうよ
|
ユーザー |
![]() |
提出日時 | 2019-06-14 21:41:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 758 bytes |
コンパイル時間 | 1,490 ms |
コンパイル使用メモリ | 159,484 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-09 00:42:02 |
合計ジャッジ時間 | 3,742 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 WA * 13 |
ソースコード
#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; int a = l%n; cnt += n-1-a+1; int b = r%n; cnt += b-(n-1)+1; ll base = (r-l+1-cnt)/n; rep(i, n) { ll ans = base; if (i >= a) ans++; if (i <= b) ans++; cout << ans << endl; } }