結果

問題 No.836 じょうよ
ユーザー 東前頭十一枚目
提出日時 2019-06-15 09:53:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 109 ms / 1,000 ms
コード長 649 bytes
コンパイル時間 1,649 ms
コンパイル使用メモリ 166,036 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 14:11:43
合計ジャッジ時間 3,614 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
const int INF = 1145141919, MOD = 1e9 + 7;
const int64_t LINF = 8931145141919364364, LMOD = 998244353;
// const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
// const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};

int main() {
    int64_t l,r,n; cin>>l>>r>>n;
    for(int64_t i=0;i<n;i++){
        int64_t sum=r/n-(l-1)/n;
        if(i==0){
            cout<<sum<<endl;
            continue;
        }
        if(l%n!=0 and l%n<=i){
            sum++;
        }
        if(r%n<i) sum--;
        cout<<sum<<endl;
    }
    return 0;
}
0