結果

問題 No.836 じょうよ
ユーザー htensaihtensai
提出日時 2019-11-11 17:17:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 194 ms / 1,000 ms
コード長 676 bytes
コンパイル時間 2,734 ms
コンパイル使用メモリ 71,696 KB
実行使用メモリ 58,780 KB
最終ジャッジ日時 2023-10-13 08:06:51
合計ジャッジ時間 9,214 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 187 ms
58,608 KB
testcase_01 AC 106 ms
55,660 KB
testcase_02 AC 113 ms
56,148 KB
testcase_03 AC 109 ms
56,112 KB
testcase_04 AC 109 ms
55,852 KB
testcase_05 AC 111 ms
56,352 KB
testcase_06 AC 108 ms
55,764 KB
testcase_07 AC 109 ms
55,852 KB
testcase_08 AC 105 ms
55,880 KB
testcase_09 AC 104 ms
56,352 KB
testcase_10 AC 105 ms
56,280 KB
testcase_11 AC 138 ms
56,296 KB
testcase_12 AC 155 ms
55,956 KB
testcase_13 AC 128 ms
55,712 KB
testcase_14 AC 110 ms
56,336 KB
testcase_15 AC 137 ms
55,604 KB
testcase_16 AC 194 ms
58,780 KB
testcase_17 AC 186 ms
58,620 KB
testcase_18 AC 137 ms
56,156 KB
testcase_19 AC 144 ms
56,708 KB
testcase_20 AC 165 ms
58,412 KB
testcase_21 AC 117 ms
56,132 KB
testcase_22 AC 134 ms
56,216 KB
testcase_23 AC 144 ms
57,820 KB
testcase_24 AC 120 ms
55,592 KB
testcase_25 AC 141 ms
56,284 KB
testcase_26 AC 118 ms
55,612 KB
testcase_27 AC 112 ms
56,204 KB
testcase_28 AC 126 ms
55,968 KB
testcase_29 AC 116 ms
55,756 KB
testcase_30 AC 119 ms
55,908 KB
testcase_31 AC 128 ms
56,052 KB
testcase_32 AC 137 ms
55,644 KB
testcase_33 AC 117 ms
55,684 KB
testcase_34 AC 135 ms
56,048 KB
testcase_35 AC 133 ms
55,772 KB
testcase_36 AC 148 ms
55,876 KB
testcase_37 AC 143 ms
55,772 KB
testcase_38 AC 157 ms
58,168 KB
testcase_39 AC 150 ms
58,096 KB
testcase_40 AC 159 ms
57,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static TreeSet<Integer> primes;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong();
		long r = sc.nextLong();
		int n = sc.nextInt();
		long[] arrL = new long[n];
		Arrays.fill(arrL, (l - 1) / n);
		long modL = (l - 1) % n;
		for (int i = 1; i <= modL; i++) {
		    arrL[i]++;
		}
		long[] arrR = new long[n];
		Arrays.fill(arrR, r / n);
		long modR = r % n;
		for (int i = 1; i <= modR; i++) {
		    arrR[i]++;
		}
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < n; i++) {
		    sb.append(arrR[i] - arrL[i]).append("\n");
		}
	    System.out.print(sb);
	}
}
0