結果

問題 No.836 じょうよ
ユーザー kpinkcat
提出日時 2023-08-22 11:18:49
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 666 bytes
コンパイル時間 3,787 ms
コンパイル使用メモリ 100,340 KB
最終ジャッジ日時 2025-02-16 12:13:26
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;


int main()
{
    long long l, r, n, p , q, s;
    cin >> l >> r >> n;
    p = r % n;
    q = l % n;
    s = (r - l)/n;
    for (long long i = 0; i < n; i++){
        if(p > q && (i < q || i > p)) cout << s << endl;
        else if (p > q && i <= p && q <= i) cout << s + 1 << endl;
        else if (p == q && i == p) cout << s + 1 << endl;
        else if (p == q && i != p) cout << s << endl;
        else if (p < q && (i >= q || i <= p)) cout << s + 1 << endl;
        else cout << s << endl;
    }
}
0