結果

問題 No.1338 Giant Class
ユーザー first_vilfirst_vil
提出日時 2022-05-19 13:57:24
言語 Go
(1.22.1)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 11,611 ms
コンパイル使用メモリ 225,252 KB
実行使用メモリ 13,928 KB
最終ジャッジ日時 2023-10-17 22:56:04
合計ジャッジ時間 15,414 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 111 ms
7,876 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 99 ms
8,500 KB
testcase_07 AC 135 ms
8,916 KB
testcase_08 AC 93 ms
8,760 KB
testcase_09 AC 85 ms
8,632 KB
testcase_10 AC 147 ms
8,892 KB
testcase_11 AC 14 ms
4,348 KB
testcase_12 AC 101 ms
7,752 KB
testcase_13 AC 99 ms
9,024 KB
testcase_14 AC 25 ms
4,348 KB
testcase_15 AC 37 ms
4,532 KB
testcase_16 AC 13 ms
4,348 KB
testcase_17 AC 100 ms
8,972 KB
testcase_18 AC 25 ms
4,348 KB
testcase_19 AC 47 ms
6,292 KB
testcase_20 AC 174 ms
13,904 KB
testcase_21 AC 175 ms
13,848 KB
testcase_22 AC 172 ms
13,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main
import (
    "fmt"
    "os"
    "bufio"
)
func main() {
    r:=bufio.NewReader(os.Stdin)
    wr:=bufio.NewWriter(os.Stdout)
    defer wr.Flush()
    var h,w int64
    var q int
    fmt.Fscan(r,&h,&w,&q)
    m:=make(map[int64]int64)
    ans:=h*w
    for i:=0;i<q;i++ {
        var y,x int64
        fmt.Fscan(r,&y,&x)
        y=h+1-y
        if v:=m[x];v<y {
            ans-=y-v
            m[x]=y
        }
        fmt.Fprintln(wr,ans)
    }
}
0