結果

問題 No.836 じょうよ
ユーザー outline
提出日時 2020-03-20 19:11:54
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 11 ms / 1,000 ms
コード長 557 bytes
コンパイル時間 1,586 ms
コンパイル使用メモリ 167,768 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-14 14:30:21
合計ジャッジ時間 3,186 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll l, r, n;
    cin >> l >> r >> n;
    vector<ll> L(n, -1), R(n, -1);
    for(ll i = 0; i < n; ++i){
        if(l + i <= r)  L[(l + i) % n] = l + i;
        if(r - i >= l)  R[(r - i) % n] = r - i;
    }
    for(int i = 0; i < n; ++i){
        if(L[i] == -1 && R[i] == -1)    cout << 0 << "\n";
        else if(L[i] == -1 || R[i] == -1)   cout << 1 << "\n";
        else    cout << (R[i] - L[i]) / n + 1 << "\n";
    }
}
0