結果

問題 No.836 じょうよ
ユーザー Arumakan1727Arumakan1727
提出日時 2019-06-14 21:57:31
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 9 ms / 1,000 ms
コード長 1,160 bytes
コンパイル時間 4,341 ms
コンパイル使用メモリ 163,332 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-09 00:26:26
合計ジャッジ時間 3,298 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
// Custom Header <<<
#define ALL(x) x.begin(), x.end()
#define rep(i, s, n)      for(int i(s); i < int(n); ++i)
#ifndef YDK
#define eprintf(...)
#endif
using namespace std;
using i64 = long long;
using pii = pair<int, int>;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD  = int(1e9) + 7;
// >>>

signed main()
{
    i64 l, r, n;
    cin >> l >> r >> n;

    const i64 L = (l + n - 1) / n * n;
    const i64 R = r / n * n;
    const i64 base = (R - L) / n;

    bool x[100010] {};
    bool y[100010] {};

    for (i64 i = l; i < L; ++i) {
        x[i % n] = true;
    }
    for (i64 i = R; i <= r; ++i) {
        y[i % n] = true;
    }

    eprintf("(L, R) = (%lld, %lld) base = %lld\n", L, R, base);
    for (int p = 0; p < n; ++p) {
        i64 ans = base;
        if (x[p]) ++ans;
        if (y[p]) ++ans;
        cout << ans << '\n';

    }
    return 0;
}

/* vim:set foldmethod=marker foldmarker=<<<,>>> : */
0