結果

問題 No.836 じょうよ
ユーザー torisasami4torisasami4
提出日時 2019-06-14 21:29:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 2,322 bytes
コンパイル時間 863 ms
コンパイル使用メモリ 73,104 KB
実行使用メモリ 8,676 KB
最終ジャッジ日時 2023-08-08 14:49:29
合計ジャッジ時間 3,905 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
8,380 KB
testcase_01 AC 5 ms
7,748 KB
testcase_02 AC 4 ms
7,700 KB
testcase_03 AC 4 ms
7,812 KB
testcase_04 AC 4 ms
7,568 KB
testcase_05 AC 5 ms
7,720 KB
testcase_06 AC 5 ms
7,716 KB
testcase_07 AC 5 ms
7,696 KB
testcase_08 AC 4 ms
7,740 KB
testcase_09 AC 4 ms
7,800 KB
testcase_10 AC 4 ms
7,800 KB
testcase_11 AC 13 ms
7,692 KB
testcase_12 AC 17 ms
7,524 KB
testcase_13 AC 13 ms
7,560 KB
testcase_14 AC 6 ms
7,444 KB
testcase_15 AC 14 ms
7,808 KB
testcase_16 AC 98 ms
8,296 KB
testcase_17 AC 90 ms
8,464 KB
testcase_18 AC 12 ms
7,520 KB
testcase_19 AC 21 ms
7,824 KB
testcase_20 AC 56 ms
7,948 KB
testcase_21 AC 8 ms
7,512 KB
testcase_22 AC 47 ms
8,004 KB
testcase_23 AC 100 ms
8,268 KB
testcase_24 AC 11 ms
7,692 KB
testcase_25 AC 37 ms
7,696 KB
testcase_26 AC 6 ms
7,692 KB
testcase_27 AC 7 ms
7,632 KB
testcase_28 AC 13 ms
7,496 KB
testcase_29 AC 7 ms
7,512 KB
testcase_30 AC 7 ms
7,768 KB
testcase_31 AC 15 ms
7,720 KB
testcase_32 AC 14 ms
7,444 KB
testcase_33 AC 7 ms
7,512 KB
testcase_34 AC 14 ms
7,564 KB
testcase_35 AC 15 ms
7,848 KB
testcase_36 AC 60 ms
8,132 KB
testcase_37 AC 54 ms
7,960 KB
testcase_38 AC 81 ms
8,148 KB
testcase_39 AC 68 ms
8,340 KB
testcase_40 AC 128 ms
8,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<set>
#include<string>
using namespace std;
int gcd(int a, int b) {
	int c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}
	return b;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};
typedef long long ll;

ll M = 1000000007;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)

ll mpow(ll x, ll n) {
	ll ans = 1;
	while (n != 0) {
		if (n & 1) ans = ans * x % M;
		x = x * x % M;
		n = n >> 1;
	}
	return ans;
}
ll comb(ll a, ll b) {
	if (a == 0 && b == 0)return 1;
	if (a < b || a < 0)return 0;
	ll tmp = ifac[a - b] * ifac[b] % M;
	return tmp * fac[a] % M;
}
// mod. m での a の逆元 a^{-1} を計算する
long long modinv(long long a) {
	long long b = M, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= M;
	if (u < 0) u += M;
	return u;
}
vector<vector<ll>> mul(vector<vector<ll>> a,vector<vector<ll>> b,int n){
	int i,j,k,t;
	vector<vector<ll>> c(n);
	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			t = 0;
			for (k = 0; k < n; k++)
				t = (t + a[i][k]*b[k][j] % M)%M;
			c[i].push_back(t);
		}
	}
	return c;
}
int main() {
	ll n,l,r,i;
	cin >>l>>r>> n;
	ll cl=l/n, cr=r/n, ans[111111];
	for (i = 0; i < n; i++)
		ans[i] = cr - cl - 1;
	for (i = l; i < (cl + 1)*n; i++)
		ans[i%n]++;
	for (i = cr * n; i <= r; i++)
		ans[i%n]++;
	for (i = 0; i < n; i++)
		cout << ans[i] << endl;
}
0