結果

問題 No.2043 Ohuton and Makura
ユーザー kokatsukokatsu
提出日時 2022-08-19 22:26:43
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 1,787 ms
コンパイル使用メモリ 200,160 KB
実行使用メモリ 8,732 KB
最終ジャッジ日時 2023-09-04 18:10:07
合計ジャッジ時間 3,128 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 4 ms
4,888 KB
testcase_03 AC 3 ms
4,612 KB
testcase_04 AC 9 ms
6,624 KB
testcase_05 AC 8 ms
6,092 KB
testcase_06 AC 4 ms
6,100 KB
testcase_07 AC 7 ms
4,380 KB
testcase_08 AC 3 ms
4,624 KB
testcase_09 AC 5 ms
6,124 KB
testcase_10 AC 6 ms
5,676 KB
testcase_11 AC 9 ms
5,824 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 4 ms
7,876 KB
testcase_15 AC 8 ms
4,384 KB
testcase_16 AC 10 ms
7,704 KB
testcase_17 AC 7 ms
4,380 KB
testcase_18 AC 5 ms
8,460 KB
testcase_19 AC 10 ms
8,732 KB
testcase_20 AC 11 ms
8,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    long A, B, S;
    readf("%d %d %d\n", A, B, S);

    auto table = new long[](B+1);
    foreach (i; 1 .. B+1) {
        table[i] = B - i + 1;
        table[i] += table[i-1];
    }

    long res;
    foreach (i; 1 .. A+1) {
        long D = min(B, S/i);
        res += (A - i + 1) * table[D];
    }

    res.writeln;
}
0