結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-17 04:28:32 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 1,000 ms |
| コード長 | 505 bytes |
| コンパイル時間 | 2,138 ms |
| コンパイル使用メモリ | 61,188 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 06:41:43 |
| 合計ジャッジ時間 | 2,843 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
const MOD = 1_0000_0000_7
const HIGH = int32.high
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
result = 0
while true:
var k = getchar_unlocked()
if k < '0' or k > '9': break
else: result = 10 * result + k.ord - '0'.ord
let n = scan()
var res = 0
for _ in 0..<n:
var c = scan()
var d = scan()
c = (c+1) shr 1
if c > HIGH : c = c mod MOD
if d > HIGH : d = d mod MOD
res += c * d
if res > HIGH: res = res mod MOD
echo res