結果

問題 No.11 カードマッチ
ユーザー fmhrfmhr
提出日時 2015-09-18 15:14:53
言語 Go
(1.22.1)
結果
MLE  
実行時間 -
コード長 615 bytes
コンパイル時間 10,990 ms
コンパイル使用メモリ 239,720 KB
実行使用メモリ 813,436 KB
最終ジャッジ日時 2024-04-19 03:22:53
合計ジャッジ時間 15,242 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 0 ms
5,376 KB
testcase_04 MLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	solve11()
}

func solve11(){
	var W, H, N int
	fmt.Scan(&W, &H, &N)
	var s, k int
	var ans int
	check := makeDoubleSliceInt(W, H)
	for i:=0; i<N; i++ {
	    fmt.Scan(&s, &k)
		s--
		k--
		if true{
			for i:=0; i<W; i++ {
			    if check[i][k]==0{
					check[i][k]=1
					ans++
				}
			}
			for j:=0; j<H; j++ {
			    if check[s][j]==0{
					check[s][j]=1
					ans++
				}
			}
		}
		ans--
	}
	fmt.Println(ans)
//	fmt.Println(check)
}

func makeDoubleSliceInt(y, x int) (ss [][]int) {
	ss = make([][]int, y)
	for i := range ss {
		ss[i] = make([]int, x)
	}
	return
}
0