結果
| 問題 | No.586 ダブルブッキング |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-06 13:55:41 |
| 言語 | Go (1.26.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 451 bytes |
| 記録 | |
| コンパイル時間 | 12,352 ms |
| コンパイル使用メモリ | 273,304 KB |
| 実行使用メモリ | 281,276 KB |
| 最終ジャッジ日時 | 2026-04-02 07:19:03 |
| 合計ジャッジ時間 | 12,523 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 |
ソースコード
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {
sc := bufio.NewScanner(os.Stdin)
sc.Split(bufio.ScanWords)
sc.Scan()
p1, _ := strconv.Atoi(sc.Text())
sc.Scan()
p2, _ := strconv.Atoi(sc.Text())
sc.Scan()
n, _ := strconv.Atoi(sc.Text())
r := make(map[int]int, n)
loss := 0
for i := 0; i < n; i++ {
sc.Scan()
t, _ := strconv.Atoi(sc.Text())
if r[t] >= 1 {
loss += p1 + p2
}
r[t]++
}
fmt.Println(loss)
}