結果

問題 No.146 試験監督(1)
ユーザー バカらっくバカらっく
提出日時 2018-03-06 00:00:54
言語 Swift
(5.10.0)
結果
AC  
実行時間 755 ms / 1,000 ms
コード長 337 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 131,496 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-08-20 10:30:41
合計ジャッジ時間 5,256 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 752 ms
7,856 KB
testcase_01 AC 755 ms
7,904 KB
testcase_02 AC 754 ms
7,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let inputCount = Int(readLine()!)!

let mod:Int64 = 1000000000 + 7
var ans:Int64 = 0
for _ in 0..<inputCount {
    let inpt = readLine()!.split(separator: " ").map({Int64($0)!})
    ans += ((inpt[0] / 2) % mod) * (inpt[1] % mod)
    ans = ans % mod
    if inpt[0] % 2 > 0 {
        ans += inpt[1]
    }
    ans = ans % mod
}

print(ans)
0