結果

問題 No.836 じょうよ
コンテスト
ユーザー bal4u
提出日時 2019-06-15 22:27:15
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 5 ms / 1,000 ms
コード長 955 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 154 ms
コンパイル使用メモリ 38,976 KB
最終ジャッジ日時 2026-02-22 03:36:26
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// yukicoder: 836 じょうよ
// 2019.6.15 bal4u

#include <stdio.h>
#include <string.h>

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
long long in()    // 非負整数の入力
{
	long long n = 0; int c = gc();
	//	while (isspace(c)) c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void out(long long n)  // 非負整数の表示(出力)
{
	int i;
	char b[50];

	if (!n) pc('0');
	else {
		//		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

char e[100005], f[100005];

int main()
{
	long long l, r, a, b;
	int i, n;
	
	l = in(), r = in(), n = (int)in();
	a = 0;
	if (l > 1) {
		a = --l / n;
		memset(e, 1, (int)(l%n));
	}
	b = r / n;
	memset(f, 1, (int)(r%n));
	n--, out(b - a + f[n] - e[n]);
	for (i = 0; i < n; i++) out(b - a + f[i] - e[i]);
	return 0;
}
0