結果

問題 No.269 見栄っ張りの募金活動
ユーザー smz_8110smz_8110
提出日時 2018-08-17 16:53:02
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 756 ms
コンパイル使用メモリ 104,576 KB
実行使用メモリ 33,024 KB
最終ジャッジ日時 2024-04-17 16:32:50
合計ジャッジ時間 4,099 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
17,664 KB
testcase_01 AC 23 ms
17,792 KB
testcase_02 AC 23 ms
17,792 KB
testcase_03 AC 40 ms
17,712 KB
testcase_04 AC 183 ms
22,784 KB
testcase_05 AC 22 ms
17,792 KB
testcase_06 AC 22 ms
17,664 KB
testcase_07 AC 1,237 ms
33,024 KB
testcase_08 AC 23 ms
17,792 KB
testcase_09 AC 21 ms
17,920 KB
testcase_10 WA -
testcase_11 AC 31 ms
18,304 KB
testcase_12 AC 22 ms
17,664 KB
testcase_13 AC 58 ms
18,944 KB
testcase_14 AC 22 ms
17,844 KB
testcase_15 AC 47 ms
18,560 KB
testcase_16 AC 22 ms
17,792 KB
testcase_17 AC 21 ms
17,792 KB
testcase_18 AC 314 ms
22,656 KB
testcase_19 AC 68 ms
18,688 KB
testcase_20 AC 24 ms
17,712 KB
testcase_21 AC 23 ms
17,972 KB
testcase_22 AC 44 ms
18,176 KB
testcase_23 AC 25 ms
18,048 KB
testcase_24 AC 27 ms
17,836 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    const int A = 1000000007;
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(' ');
        var n = int.Parse(input[0]);
        var s = int.Parse(input[1]);
        var k = int.Parse(input[2]);

        int m = s - (n - 1) * n * k / 2;
        int c = 0;
        for (var l = 1; l <= n && l <= m; l++)
        {
            long[] t = new long[m - l + 2];
            for (var i = 0; i < t.Length; i++) { t[i] = 1; }
            for (var i = 2; i <= l; i++)
            {
                for (var j = i; j <= m - l; j++)
                {
                    t[j] = (t[j] + t[j - i]) % A;
                }
            }
            c = (int)((c + t[m - l]) % A);
        }
        Console.WriteLine(c);
    }
}

0