結果

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
    
    ll l,r,n;
    cin>>l>>r>>n;
    vector<ll> v;
    ll a = r/n - (l-1)/n;
    ll b = r%n;
    ll c = (l-1)%n;
    if(n==1){
        cout << a <<"\n";
        return 0;
    }
    for(int i=0;i<n;i++){
        if(i<=b && i<=c){
            cout << a << "\n";
            
        }
        else if(i<=b){
            cout << a+1 << "\n";
        }
        else if(i<=c){
            cout << a-1 << "\n";
        }
        else cout << a <<"\n";
    }

}
0