結果

問題 No.836 じょうよ
ユーザー ks2mks2m
提出日時 2019-06-14 22:16:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 228 ms / 1,000 ms
コード長 655 bytes
コンパイル時間 4,033 ms
コンパイル使用メモリ 74,344 KB
実行使用メモリ 47,112 KB
最終ジャッジ日時 2024-04-26 17:04:25
合計ジャッジ時間 10,752 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 210 ms
45,312 KB
testcase_01 AC 120 ms
39,936 KB
testcase_02 AC 124 ms
41,072 KB
testcase_03 AC 119 ms
41,252 KB
testcase_04 AC 120 ms
41,024 KB
testcase_05 AC 119 ms
40,168 KB
testcase_06 AC 115 ms
41,212 KB
testcase_07 AC 119 ms
41,228 KB
testcase_08 AC 119 ms
41,200 KB
testcase_09 AC 118 ms
41,328 KB
testcase_10 AC 114 ms
40,028 KB
testcase_11 AC 161 ms
41,752 KB
testcase_12 AC 150 ms
41,856 KB
testcase_13 AC 152 ms
41,688 KB
testcase_14 AC 141 ms
41,464 KB
testcase_15 AC 166 ms
41,984 KB
testcase_16 AC 228 ms
45,800 KB
testcase_17 AC 221 ms
46,624 KB
testcase_18 AC 158 ms
41,528 KB
testcase_19 AC 160 ms
41,912 KB
testcase_20 AC 194 ms
43,784 KB
testcase_21 AC 147 ms
41,312 KB
testcase_22 AC 194 ms
44,148 KB
testcase_23 AC 213 ms
45,932 KB
testcase_24 AC 158 ms
41,740 KB
testcase_25 AC 182 ms
42,768 KB
testcase_26 AC 131 ms
40,568 KB
testcase_27 AC 143 ms
41,384 KB
testcase_28 AC 155 ms
41,736 KB
testcase_29 AC 146 ms
40,964 KB
testcase_30 AC 132 ms
41,208 KB
testcase_31 AC 167 ms
42,148 KB
testcase_32 AC 163 ms
41,936 KB
testcase_33 AC 143 ms
41,316 KB
testcase_34 AC 161 ms
41,720 KB
testcase_35 AC 160 ms
41,740 KB
testcase_36 AC 200 ms
43,580 KB
testcase_37 AC 200 ms
43,372 KB
testcase_38 AC 195 ms
44,248 KB
testcase_39 AC 191 ms
44,168 KB
testcase_40 AC 219 ms
47,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong();
		long r = sc.nextLong() + 1;
		long n = sc.nextLong();
		sc.close();

		long a = l % n;
		long b = r % n;
		long c = (r - l) / n;
		PrintWriter pw = new PrintWriter(System.out);
		for (int i = 0; i < n; i++) {
			long ans = c;
			if (a < b) {
				if (i >= a) {
					ans++;
				}
				if (i >= b) {
					ans--;
				}
			}
			if (b < a) {
				if (i < b) {
					ans++;
				}
				if (a <= i) {
					ans++;
				}
			}
			pw.println(ans);
		}
		pw.flush();
	}
}
0