結果

問題 No.836 じょうよ
ユーザー Arumakan1727
提出日時 2019-06-14 21:57:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 10 ms / 1,000 ms
コード長 1,160 bytes
コンパイル時間 1,504 ms
コンパイル使用メモリ 167,384 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 05:40:49
合計ジャッジ時間 2,810 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

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