結果

問題 No.836 じょうよ
ユーザー OlandOland
提出日時 2019-06-14 22:02:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 168 ms / 1,000 ms
コード長 3,233 bytes
コンパイル時間 2,651 ms
コンパイル使用メモリ 81,336 KB
実行使用メモリ 56,068 KB
最終ジャッジ日時 2024-04-26 16:36:52
合計ジャッジ時間 8,367 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
55,380 KB
testcase_01 AC 55 ms
50,228 KB
testcase_02 AC 55 ms
50,204 KB
testcase_03 AC 56 ms
50,168 KB
testcase_04 AC 53 ms
50,076 KB
testcase_05 AC 55 ms
50,484 KB
testcase_06 AC 53 ms
50,364 KB
testcase_07 AC 54 ms
50,232 KB
testcase_08 AC 56 ms
50,028 KB
testcase_09 AC 55 ms
50,516 KB
testcase_10 AC 53 ms
50,196 KB
testcase_11 AC 102 ms
51,276 KB
testcase_12 AC 105 ms
51,448 KB
testcase_13 AC 100 ms
51,660 KB
testcase_14 AC 61 ms
50,232 KB
testcase_15 AC 100 ms
51,632 KB
testcase_16 AC 168 ms
56,068 KB
testcase_17 AC 157 ms
55,232 KB
testcase_18 AC 103 ms
51,736 KB
testcase_19 AC 117 ms
51,760 KB
testcase_20 AC 142 ms
54,176 KB
testcase_21 AC 69 ms
50,748 KB
testcase_22 AC 115 ms
54,624 KB
testcase_23 AC 140 ms
55,172 KB
testcase_24 AC 97 ms
51,104 KB
testcase_25 AC 118 ms
52,560 KB
testcase_26 AC 59 ms
50,372 KB
testcase_27 AC 67 ms
50,828 KB
testcase_28 AC 99 ms
51,508 KB
testcase_29 AC 73 ms
51,020 KB
testcase_30 AC 66 ms
50,824 KB
testcase_31 AC 102 ms
51,684 KB
testcase_32 AC 101 ms
51,668 KB
testcase_33 AC 66 ms
50,672 KB
testcase_34 AC 95 ms
51,972 KB
testcase_35 AC 102 ms
51,376 KB
testcase_36 AC 123 ms
54,616 KB
testcase_37 AC 117 ms
54,228 KB
testcase_38 AC 137 ms
54,528 KB
testcase_39 AC 132 ms
54,376 KB
testcase_40 AC 155 ms
55,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.Function;
import java.util.stream.Collectors;

@SuppressWarnings("unused")
public class Main {
	String fileName = "input.txt";
	final boolean isDebug = false;
	//final boolean isDebug = true;
	FastScanner in = new FastScanner(System.in);
	PrintWriter out = new PrintWriter(System.out);
	final int MOD = (int)1e9+7;
	final long INF = Long.MAX_VALUE / 2;
	//final int INF = Integer.MAX_VALUE / 2;
	
	//System.out.println();はつかわない!!
	void solve() throws Exception{
		long L = in.nextLong(), R = in.nextLong();
		int N = in.nextInt();
		long[] num = new long[N];
		if(R - L + 1 <= N){
			for(long i = L; i <= R; i++) num[(int)(i % N)]++;
		}else{
			Arrays.fill(num, (R - L + 1) / N);
			long last = ((L % N) + N - 1) % N;
			for(long i = R; i >= L; i--){
				if(i % N == last) break;
				num[(int)(i % N)]++;
			}
		}
		for(int i = 0; i < N; i++) out.println(num[i]);
	}
	
	/* end solve */
	
	/* main */
	public static void main(String[] args) throws Exception {
		new Main().m();
	}
	
	void m() throws Exception {
		if(isDebug) in = new FastScanner(new FileInputStream(fileName));
		solve();
		out.flush();
	}
	/* end main */
}
/* end Main */

class FastScanner {
	Reader input;

	FastScanner() {this(System.in);}
	FastScanner(InputStream stream) {this.input = new BufferedReader(new InputStreamReader(stream));}
	
	int nextInt() {return (int) nextLong();}

	long nextLong() {
		try {
			int sign = 1;
			int b = input.read();
			while ((b < '0' || '9' < b) && b != '-' && b != '+') {
				b = input.read();
			}
			if (b == '-') {
				sign = -1;
				b = input.read();
			} else if (b == '+') {
				b = input.read();
			}
			long ret = b - '0';
			while (true) {
				b = input.read();
				if (b < '0' || '9' < b) return ret * sign;
				ret *= 10;
				ret += b - '0';
			}
		} catch (IOException e) {
			e.printStackTrace();
			return -1;
		}
	}

	double nextDouble() {
		try {
			double sign = 1;
			int b = input.read();
			while ((b < '0' || '9' < b) && b != '-' && b != '+') {
				b = input.read();
			}
			if (b == '-') {
				sign = -1;
				b = input.read();
			} else if (b == '+') {
				b = input.read();
			}
			double ret = b - '0';
			while (true) {
				b = input.read();
				if (b < '0' || '9' < b) break;
				ret *= 10;
				ret += b - '0';
			}
			if (b != '.') return sign * ret;
			double div = 1;
			b = input.read();
			while ('0' <= b && b <= '9') {
				ret *= 10;
				ret += b - '0';
				div *= 10;
				b = input.read();
			}
			return sign * ret / div;
		} catch (IOException e) {
			e.printStackTrace();
			return Double.NaN;
		}
	}

	char nextChar() {
		try {
			int b = input.read();
			while (Character.isWhitespace(b)) {
				b = input.read();
			}
			return (char) b;
		} catch (IOException e) {
			e.printStackTrace();
			return 0;
		}
	}

	String nextStr() {
		try {
			StringBuilder sb = new StringBuilder();
			int b = input.read();
			while (Character.isWhitespace(b)) {
				b = input.read();
			}
			while (b != -1 && !Character.isWhitespace(b)) {
				sb.append((char) b);
				b = input.read();
			}
			return sb.toString();
		} catch (IOException e) {
			e.printStackTrace();
			return "";
		}
	}
}
0