結果

問題 No.836 じょうよ
コンテスト
ユーザー bamboo_circle
提出日時 2019-06-14 21:40:32
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 740 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 834 ms
コンパイル使用メモリ 179,052 KB
実行使用メモリ 10,056 KB
最終ジャッジ日時 2026-09-21 15:18:59
合計ジャッジ時間 3,436 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 32 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
    int ln = l % n, rn = r % n;
    ll base = (r - l + 1 - (n - ln) - rn) / n;
    if(l == r){
        for(int i = 0; i < n; i++){
            if(l % n == i){
                cout << 1 << '\n';
            }else{
                cout << 0 << '\n';
            }
        }
    }else{
        for(int i = 0; i < n; i++){
            ll temp = base;
            if(i <= rn) temp++;
            if(i >= ln) temp++;
            cout << temp << '\n';
        }
    }
    
}
0