結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
ebicochineal
|
| 提出日時 | 2016-06-06 01:44:59 |
| 言語 | Go (1.23.4) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,033 bytes |
| コンパイル時間 | 12,551 ms |
| コンパイル使用メモリ | 225,736 KB |
| 実行使用メモリ | 7,712 KB |
| 最終ジャッジ日時 | 2024-10-11 00:59:21 |
| 合計ジャッジ時間 | 12,468 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
ソースコード
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"math"
"strings"
)
func main() {
N := InputInt()
var c, d, a int
mod := int(math.Pow(10, 9)) + 7
for i := 0; i < N; i++ {
s := strings.Split(Input(), " ")
c = ToInt(s[0])
d = ToInt(s[1])
a += ((c / 2 + c % 2) * d) % mod
}
Print(a % mod)
}
func Print(x ...interface{}){
l := len(x) - 1
for ii, vi := range x {
fmt.Print(vi)
if ii == l {
fmt.Print("\n")
} else {
fmt.Print(" ")
}
}
}
var sc = bufio.NewScanner(os.Stdin)
func Input() string {
sc.Scan()
return sc.Text()
}
func InputInt() int {
sc.Scan()
i, e := strconv.Atoi(sc.Text())
if e != nil {panic(e)}
return i
}
func BinCount(x int) int {
s := fmt.Sprintf("%b", x)
c := 0
for _, i := range s {
if i == '1' {c += 1}
}
return c
}
func ToInt(x string) int {
i, e := strconv.Atoi(x)
if e != nil {panic(e)}
return i
}
ebicochineal