結果
| 問題 | No.836 じょうよ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-26 22:01:51 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 1,000 ms |
| コード長 | 938 bytes |
| 記録 | |
| コンパイル時間 | 695 ms |
| コンパイル使用メモリ | 137,612 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-19 23:58:01 |
| 合計ジャッジ時間 | 3,146 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 41 |
ソースコード
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int main() {
int64_t l, r, n;
cin >> l >> r >> n;
int64_t lmin = l, lmax = (l + n - 1) / n * n;
int64_t rmin = r / n * n, rmax = r + 1;
vector<int64_t> ans(n);
if (lmax <= rmin) {
for (auto i = 0; i < n; ++i) {
ans[i] = (rmin - lmax) / n;
}
for (auto ll = lmin; ll < lmax; ++ll) {
++ans[ll % n];
}
for (auto rr = rmin; rr < rmax; ++rr) {
++ans[rr % n];
}
} else {
for (auto i = l; i <= r; ++i) {
++ans[i % n];
}
}
for (auto i = 0; i < n; ++i) {
cout << ans[i] << endl;
}
return 0;
}