結果

問題 No.836 じょうよ
ユーザー bamboo_circle
提出日時 2019-06-14 21:47:50
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 8 ms / 1,000 ms
コード長 752 bytes
コンパイル時間 1,385 ms
コンパイル使用メモリ 159,364 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 04:01:56
合計ジャッジ時間 2,906 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

using ll = long long;
int INF = numeric_limits<int>::max() / 2;
ll LINF = numeric_limits<ll>::max() / 2;
int MOD = 1e9 + 7;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll l, r, n;
    cin >> l >> r >> n;
    ll ln = l % n, rn = r % n;
    ll base = (r - l + 1 - (n - ln) - rn - 1) / n;
    if(base == 0){
        vector<ll> ans(n,0);
        for(ll i = l; i <= r; i++){
            ans[i % n]++;
        }
        for(int i = 0; i < n; i++){
            cout << ans[i] << '\n';
        }
    }else{
        for(int i = 0; i < n; i++){
            ll temp = base;
            if(i <= rn) temp++;
            if(i >= ln) temp++;
            cout << temp << '\n';
        }
    }
    
}
0