結果

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

ソースコード

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 >= p) cout << s + 1 << endl;
        else if (p > q && i < p && q < i) cout << s << endl;
        else if (p > q && i < q) 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 >= p && i <= q) cout << s + 1 << endl;
        else cout << s << endl;
    }
}
0