結果

問題 No.988 N×Mマス計算(総和)
ユーザー SugihaMSugihaM
提出日時 2020-04-16 22:14:32
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 730 bytes
コンパイル時間 11,147 ms
コンパイル使用メモリ 214,032 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 12:22:42
合計ジャッジ時間 17,310 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}
func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, 100000007)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(Scanner())
	m, _ := strconv.Atoi(Scanner())
	k, _ := strconv.Atoi(Scanner())
	mark := Scanner()
	ver := make([]int, n)
	side := make([]int, m)
	for i := 0; i < m; i++ {
		side[i], _ = strconv.Atoi(Scanner())
	}
	for i := 0; i < n; i++ {
		ver[i], _ = strconv.Atoi(Scanner())
	}
	ans := 0

	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			if mark == "+" {
				ans += side[j] + ver[i]
			} else {
				ans += side[j] * ver[i]
			}
		}
	}
	fmt.Println(ans % k)
}
0