結果

問題 No.836 じょうよ
ユーザー GrenacheGrenache
提出日時 2019-06-29 11:50:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 254 ms / 1,000 ms
コード長 795 bytes
コンパイル時間 3,269 ms
コンパイル使用メモリ 71,504 KB
実行使用メモリ 59,228 KB
最終ジャッジ日時 2023-09-14 23:09:27
合計ジャッジ時間 13,331 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 240 ms
59,228 KB
testcase_01 AC 118 ms
55,628 KB
testcase_02 AC 121 ms
55,896 KB
testcase_03 AC 121 ms
56,060 KB
testcase_04 AC 122 ms
55,900 KB
testcase_05 AC 124 ms
54,064 KB
testcase_06 AC 120 ms
55,868 KB
testcase_07 AC 128 ms
55,728 KB
testcase_08 AC 122 ms
55,696 KB
testcase_09 AC 119 ms
55,600 KB
testcase_10 AC 120 ms
54,436 KB
testcase_11 AC 170 ms
54,196 KB
testcase_12 AC 169 ms
56,372 KB
testcase_13 AC 162 ms
56,548 KB
testcase_14 AC 140 ms
56,440 KB
testcase_15 AC 172 ms
55,956 KB
testcase_16 AC 254 ms
59,136 KB
testcase_17 AC 244 ms
58,740 KB
testcase_18 AC 171 ms
56,220 KB
testcase_19 AC 174 ms
56,036 KB
testcase_20 AC 209 ms
58,312 KB
testcase_21 AC 135 ms
58,356 KB
testcase_22 AC 185 ms
58,580 KB
testcase_23 AC 216 ms
58,672 KB
testcase_24 AC 160 ms
55,880 KB
testcase_25 AC 189 ms
56,004 KB
testcase_26 AC 134 ms
55,604 KB
testcase_27 AC 134 ms
56,160 KB
testcase_28 AC 160 ms
56,196 KB
testcase_29 AC 153 ms
56,132 KB
testcase_30 AC 133 ms
56,700 KB
testcase_31 AC 166 ms
55,676 KB
testcase_32 AC 163 ms
55,616 KB
testcase_33 AC 133 ms
56,152 KB
testcase_34 AC 160 ms
56,296 KB
testcase_35 AC 171 ms
55,676 KB
testcase_36 AC 202 ms
58,632 KB
testcase_37 AC 202 ms
58,168 KB
testcase_38 AC 202 ms
58,144 KB
testcase_39 AC 204 ms
57,980 KB
testcase_40 AC 247 ms
59,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.Scanner;


public class Main_yukicoder836 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		long l = sc.nextLong();
		long r = sc.nextLong();
		int n = sc.nextInt();

		for (int i = 0; i < n; i++) {
			pr.println(f(r, n, i) - f(l - 1, n, i));
		}
	}

	private static long f(long l, int n, int i) {
		long ret = l / n;

		if (i == 0) {
			return ret;
		} else {
			return ret + (l % n >= i ? 1 : 0);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
0