結果

問題 No.836 じょうよ
ユーザー mkclassmkclass
提出日時 2019-06-15 00:22:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 606 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 68,924 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 14:37:29
合計ジャッジ時間 4,535 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 12 ms
5,376 KB
testcase_32 AC 11 ms
5,376 KB
testcase_33 AC 4 ms
5,376 KB
testcase_34 AC 11 ms
5,376 KB
testcase_35 AC 11 ms
5,376 KB
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 WA -
testcase_40 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int l,r,n;
    cin >> l >> r >> n;

    int remainder1 = l % n;
    int remainder2 = r % n;
    int baseCount = (r - (n - remainder2) - (l - (n - remainder1))) / n;
    for(int i = 0; i < n; i++)
    {
        int temp = 0;
        if(remainder1 <= i)
        {
            temp++;
        }
        if(remainder2 >= i)
        {
            temp++;
        }
        if(remainder1 <= i && remainder2 >= i)
        {
            temp--;
        }
        
        cout << (baseCount + temp) << endl;;
    }
    
    return 0;
}
0