結果

問題 No.836 じょうよ
ユーザー tsunabittsunabit
提出日時 2019-07-15 04:06:11
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 1,071 bytes
コンパイル時間 3,046 ms
コンパイル使用メモリ 71,868 KB
実行使用メモリ 68,636 KB
最終ジャッジ日時 2023-08-16 15:33:44
合計ジャッジ時間 13,003 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 128 ms
56,392 KB
testcase_02 AC 126 ms
55,944 KB
testcase_03 AC 120 ms
56,076 KB
testcase_04 AC 122 ms
56,036 KB
testcase_05 AC 127 ms
55,744 KB
testcase_06 AC 122 ms
56,336 KB
testcase_07 AC 122 ms
55,956 KB
testcase_08 AC 122 ms
55,804 KB
testcase_09 AC 121 ms
56,124 KB
testcase_10 AC 121 ms
55,804 KB
testcase_11 AC 237 ms
56,596 KB
testcase_12 AC 260 ms
58,104 KB
testcase_13 AC 241 ms
57,400 KB
testcase_14 AC 178 ms
56,364 KB
testcase_15 AC 255 ms
57,116 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

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) {
//    				System.out.println(o + 1);
//    				continue;
    				f = true;
    			}
    		}
    		if(f) System.out.println(o + 1);
    		else System.out.println(o);
    	}
    	
//    	if((r - l + 1) % n == 0) {
//    		for(int i = 0; i < n; i++) {
//        		System.out.println(o);
//        	}
//    	}else {
//    		for(int i = 0; i < n; i++) {
//        		if(l % n <= i && i <= r % n) System.out.println(o + 1);
//        		else System.out.println(o);
//        	}
//    	}
    }
}
0