結果

問題 No.836 じょうよ
ユーザー yansi819yansi819
提出日時 2024-03-28 13:15:27
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 107 ms / 1,000 ms
コード長 460 bytes
コンパイル時間 3,601 ms
コンパイル使用メモリ 261,736 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-09-30 14:43:35
合計ジャッジ時間 6,038 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;

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

  vector<int> ans(n, 0);

  while (l % n != 0 && l <= r) {
    ans[l % n]++;
    l++;
  }

  ll bias = (r - l) / n;

  l += bias * n;
  while (l <= r) {
    ans[l % n]++;
    l++;
  }

  for (int i = 0; i < n; i++) {
    cout << ans[i] + bias << endl;
  }
  return 0;
}
0