結果

問題 No.836 じょうよ
ユーザー tsunabittsunabit
提出日時 2019-07-15 04:11:40
言語 Java19
(openjdk 21)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 711 bytes
コンパイル時間 3,408 ms
コンパイル使用メモリ 72,500 KB
実行使用メモリ 66,808 KB
最終ジャッジ日時 2023-08-16 15:48:52
合計ジャッジ時間 19,949 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 906 ms
64,584 KB
testcase_01 AC 130 ms
55,916 KB
testcase_02 AC 129 ms
55,732 KB
testcase_03 AC 124 ms
56,068 KB
testcase_04 AC 124 ms
56,376 KB
testcase_05 AC 131 ms
55,748 KB
testcase_06 AC 124 ms
55,552 KB
testcase_07 AC 124 ms
55,768 KB
testcase_08 AC 126 ms
55,876 KB
testcase_09 AC 125 ms
56,044 KB
testcase_10 AC 127 ms
55,856 KB
testcase_11 AC 249 ms
55,980 KB
testcase_12 AC 264 ms
57,108 KB
testcase_13 AC 231 ms
56,316 KB
testcase_14 AC 183 ms
56,168 KB
testcase_15 AC 251 ms
57,704 KB
testcase_16 AC 889 ms
66,808 KB
testcase_17 TLE -
testcase_18 AC 241 ms
56,544 KB
testcase_19 AC 356 ms
59,840 KB
testcase_20 AC 791 ms
64,908 KB
testcase_21 AC 193 ms
56,212 KB
testcase_22 AC 397 ms
63,516 KB
testcase_23 AC 835 ms
65,108 KB
testcase_24 AC 218 ms
56,552 KB
testcase_25 AC 406 ms
60,048 KB
testcase_26 AC 174 ms
55,988 KB
testcase_27 AC 197 ms
56,028 KB
testcase_28 AC 245 ms
57,172 KB
testcase_29 AC 208 ms
55,956 KB
testcase_30 AC 181 ms
56,024 KB
testcase_31 AC 356 ms
61,056 KB
testcase_32 AC 260 ms
57,292 KB
testcase_33 AC 194 ms
56,284 KB
testcase_34 AC 250 ms
57,516 KB
testcase_35 AC 260 ms
57,696 KB
testcase_36 AC 404 ms
63,744 KB
testcase_37 AC 382 ms
61,920 KB
testcase_38 AC 473 ms
64,928 KB
testcase_39 AC 427 ms
63,696 KB
testcase_40 AC 589 ms
64,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No836 {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	long l = sc.nextLong(), r = sc.nextLong(), n = sc.nextLong();
    	long o = (r - l + 1) / n;
    	
    	int hami = (int)((r - l + 1) % n);
    	long[] c = new long[hami];
    	for(int i = 0; i < hami; i++) {
    		c[i] = r % n - i;
    		if(c[i] < 0) c[i] += n;
    	}
    	
    	for(int i = 0; i < n; i++) {
    		boolean f = false;
    		for(int j = 0; j < hami; j++) {
    			if(c[j] == i) {
    				f = true;
    				break;
    			}
    		}
    		if(f) System.out.println(o + 1);
    		else System.out.println(o);
    	}
    	
    }
}
0