結果

問題 No.836 じょうよ
ユーザー bluemeganebluemegane
提出日時 2021-04-17 18:33:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 85 ms / 1,000 ms
コード長 990 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 65,032 KB
実行使用メモリ 29,548 KB
最終ジャッジ日時 2023-09-17 03:56:24
合計ジャッジ時間 5,780 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
24,964 KB
testcase_01 AC 62 ms
22,832 KB
testcase_02 AC 61 ms
20,772 KB
testcase_03 AC 62 ms
22,848 KB
testcase_04 AC 61 ms
20,796 KB
testcase_05 AC 61 ms
20,708 KB
testcase_06 AC 61 ms
20,896 KB
testcase_07 AC 60 ms
22,676 KB
testcase_08 AC 61 ms
20,812 KB
testcase_09 AC 60 ms
18,776 KB
testcase_10 AC 62 ms
20,788 KB
testcase_11 AC 63 ms
20,776 KB
testcase_12 AC 63 ms
22,808 KB
testcase_13 AC 63 ms
20,800 KB
testcase_14 AC 61 ms
20,700 KB
testcase_15 AC 62 ms
20,784 KB
testcase_16 AC 85 ms
29,548 KB
testcase_17 AC 84 ms
29,108 KB
testcase_18 AC 63 ms
20,768 KB
testcase_19 AC 66 ms
21,280 KB
testcase_20 AC 74 ms
23,224 KB
testcase_21 AC 62 ms
22,744 KB
testcase_22 AC 66 ms
20,912 KB
testcase_23 AC 73 ms
21,976 KB
testcase_24 AC 62 ms
20,696 KB
testcase_25 AC 65 ms
22,792 KB
testcase_26 AC 61 ms
20,896 KB
testcase_27 AC 61 ms
20,700 KB
testcase_28 AC 62 ms
20,676 KB
testcase_29 AC 61 ms
20,708 KB
testcase_30 AC 61 ms
22,768 KB
testcase_31 AC 62 ms
22,728 KB
testcase_32 AC 62 ms
20,772 KB
testcase_33 AC 61 ms
20,704 KB
testcase_34 AC 63 ms
22,828 KB
testcase_35 AC 62 ms
22,692 KB
testcase_36 AC 68 ms
21,264 KB
testcase_37 AC 68 ms
23,204 KB
testcase_38 AC 72 ms
23,664 KB
testcase_39 AC 68 ms
19,208 KB
testcase_40 AC 77 ms
24,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

public class Hello
{
    public static long L, r;
    public static int n;
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        L = long.Parse(line[0]);
        r = long.Parse(line[1]);
        n = int.Parse(line[2]);
        getAns();
    }
    static long[]  getArray (long t)
    {
        var res = new long[n];
        var w = t / n;
        for (int i = 0; i < n; i++) res[i] = w;
        var w2 = t % n;
        for (int i = 0; i < w2; i++)
        {
            var p = i + 1;
            if (p > n - 1) p -= n;
            res[p]++;
        }
        return res;
    }
    static void getAns ()
    {
        if (L == 1)
        {
            var aa = getArray(r);
            Console.WriteLine(string.Join("\n", aa));
            return;
        }
        var a1 = getArray(L-1);
        var a2 = getArray(r);
        for (int i = 0; i < n; i++) a2[i] -= a1[i];
        Console.WriteLine(string.Join("\n",a2));
    }
}
0