結果

問題 No.836 じょうよ
ユーザー Yang33
提出日時 2019-07-06 11:19:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 408 bytes
コンパイル時間 1,557 ms
コンパイル使用メモリ 170,012 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-25 02:35:34
合計ジャッジ時間 4,487 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,s,t) for(int i = s; i < t; i++)
using LL = long long;

int main() {

	LL L, R, N; cin >> L >> R >> N;

	// f(x):[0:x] no, are

	auto f = [&N](LL x) {
		vector<LL>res(N, x / N);
		FOR(i, 0, x%N+1) {
			res[i]++;
		}
		//if (x == 0)res[0]++;
		return res;
	};
	auto rv = f(R);
	auto lv = f(L - 1);
	FOR(i, 0, N) {
		cout << rv[i] - lv[i] << endl;
	}
}
0