結果

問題 No.1338 Giant Class
ユーザー keymoonkeymoon
提出日時 2021-01-15 21:45:03
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 627 ms / 2,000 ms
コード長 997 bytes
コンパイル時間 5,495 ms
コンパイル使用メモリ 106,180 KB
実行使用メモリ 33,484 KB
最終ジャッジ日時 2023-08-17 16:37:39
合計ジャッジ時間 13,336 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,816 KB
testcase_01 AC 63 ms
21,888 KB
testcase_02 AC 584 ms
25,992 KB
testcase_03 AC 64 ms
21,860 KB
testcase_04 AC 65 ms
23,912 KB
testcase_05 AC 66 ms
21,900 KB
testcase_06 AC 429 ms
30,252 KB
testcase_07 AC 582 ms
32,428 KB
testcase_08 AC 380 ms
30,240 KB
testcase_09 AC 350 ms
30,228 KB
testcase_10 AC 627 ms
33,484 KB
testcase_11 AC 115 ms
28,220 KB
testcase_12 AC 438 ms
27,916 KB
testcase_13 AC 370 ms
30,088 KB
testcase_14 AC 145 ms
28,256 KB
testcase_15 AC 186 ms
27,072 KB
testcase_16 AC 104 ms
25,868 KB
testcase_17 AC 382 ms
27,992 KB
testcase_18 AC 146 ms
28,196 KB
testcase_19 AC 208 ms
28,996 KB
testcase_20 AC 605 ms
28,564 KB
testcase_21 AC 625 ms
32,664 KB
testcase_22 AC 610 ms
31,528 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