結果

問題 No.1338 Giant Class
ユーザー keymoonkeymoon
提出日時 2021-01-15 21:45:03
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 589 ms / 2,000 ms
コード長 997 bytes
コンパイル時間 3,555 ms
コンパイル使用メモリ 104,832 KB
実行使用メモリ 27,520 KB
最終ジャッジ日時 2024-05-04 23:15:38
合計ジャッジ時間 11,633 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
18,944 KB
testcase_01 AC 28 ms
19,072 KB
testcase_02 AC 525 ms
23,040 KB
testcase_03 AC 28 ms
19,328 KB
testcase_04 AC 28 ms
19,456 KB
testcase_05 AC 30 ms
19,072 KB
testcase_06 AC 365 ms
24,832 KB
testcase_07 AC 565 ms
27,392 KB
testcase_08 AC 338 ms
24,832 KB
testcase_09 AC 323 ms
24,960 KB
testcase_10 AC 561 ms
27,264 KB
testcase_11 AC 78 ms
23,296 KB
testcase_12 AC 428 ms
24,960 KB
testcase_13 AC 353 ms
24,960 KB
testcase_14 AC 113 ms
23,416 KB
testcase_15 AC 158 ms
23,680 KB
testcase_16 AC 71 ms
22,564 KB
testcase_17 AC 342 ms
25,216 KB
testcase_18 AC 112 ms
23,300 KB
testcase_19 AC 180 ms
23,680 KB
testcase_20 AC 582 ms
27,264 KB
testcase_21 AC 589 ms
27,392 KB
testcase_22 AC 586 ms
27,520 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var hwq = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var h = hwq[0];
        var w = hwq[1];
        var q = hwq[2];
        long res = (long)h * w;
        Dictionary<int, int> minPos = new Dictionary<int, int>();
        for (int i = 0; i < q; i++)
        {
            var yx = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var y = yx[0] - 1;
            var x = yx[1] - 1;
            if (!minPos.ContainsKey(x)) minPos[x] = h;
            if (y < minPos[x])
            {
                res -= minPos[x] - y;
                minPos[x] = y;
            }
            Console.WriteLine(res);
        }
    }
}
0