結果

問題 No.836 じょうよ
ユーザー face4face4
提出日時 2019-06-12 20:52:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 473 ms / 1,000 ms
コード長 820 bytes
コンパイル時間 2,238 ms
コンパイル使用メモリ 75,296 KB
実行使用メモリ 64,552 KB
最終ジャッジ日時 2024-04-20 01:16:42
合計ジャッジ時間 10,737 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 368 ms
63,268 KB
testcase_01 AC 48 ms
50,264 KB
testcase_02 AC 47 ms
50,000 KB
testcase_03 AC 45 ms
50,260 KB
testcase_04 AC 46 ms
49,932 KB
testcase_05 AC 48 ms
50,272 KB
testcase_06 AC 47 ms
50,028 KB
testcase_07 AC 47 ms
50,256 KB
testcase_08 AC 46 ms
50,292 KB
testcase_09 AC 46 ms
50,124 KB
testcase_10 AC 47 ms
50,352 KB
testcase_11 AC 149 ms
52,992 KB
testcase_12 AC 162 ms
52,872 KB
testcase_13 AC 145 ms
52,628 KB
testcase_14 AC 96 ms
51,196 KB
testcase_15 AC 187 ms
52,812 KB
testcase_16 AC 386 ms
63,608 KB
testcase_17 AC 366 ms
62,972 KB
testcase_18 AC 136 ms
52,568 KB
testcase_19 AC 171 ms
53,720 KB
testcase_20 AC 279 ms
60,100 KB
testcase_21 AC 113 ms
51,320 KB
testcase_22 AC 291 ms
60,720 KB
testcase_23 AC 376 ms
63,220 KB
testcase_24 AC 129 ms
52,548 KB
testcase_25 AC 227 ms
61,376 KB
testcase_26 AC 91 ms
51,408 KB
testcase_27 AC 102 ms
51,328 KB
testcase_28 AC 135 ms
53,016 KB
testcase_29 AC 111 ms
51,716 KB
testcase_30 AC 99 ms
51,180 KB
testcase_31 AC 155 ms
52,960 KB
testcase_32 AC 165 ms
53,096 KB
testcase_33 AC 97 ms
51,328 KB
testcase_34 AC 153 ms
52,868 KB
testcase_35 AC 150 ms
53,296 KB
testcase_36 AC 291 ms
62,004 KB
testcase_37 AC 291 ms
61,312 KB
testcase_38 AC 335 ms
62,340 KB
testcase_39 AC 344 ms
64,552 KB
testcase_40 AC 473 ms
63,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;

import java.util.Scanner;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        long l, r;
        int n;
        String[] line = br.readLine().split(" ");
        l = Long.parseLong(line[0]);
        r = Long.parseLong(line[1]);
        n = Integer.parseInt(line[2]);
        int ans[] = new int[n];
    
        while(l % n != 0 && l <= r){
            ans[(int)(l%n)]++;
            l++;
        }

        long x = (r-l)/n;

        l += x * n;
        while(l <= r){
            ans[(int)(l%n)]++;
            l++;
        }
        
        for(int i = 0; i < n; i++)  System.out.println(ans[i] + x);
    }
}
0