結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-31 00:32:40 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 89 ms / 1,000 ms |
| コード長 | 547 bytes |
| コンパイル時間 | 643 ms |
| コンパイル使用メモリ | 120,400 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-06-12 03:56:48 |
| 合計ジャッジ時間 | 1,555 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
ソースコード
import std.algorithm, std.array, std.container, std.range;
import std.string, std.conv;
import std.numeric, std.math, std.bigint, std.bitmanip, std.random;
import std.stdio, std.typecons;
const auto mod = 10 ^^ 9 + 7;
void main()
{
auto n = readln.chomp.to!long;
auto cdi = iota(n)
.map!(_ => readln.split.map!(to!long))
.map!(rd => tuple(rd[0], rd[1]));
auto r = 0;
foreach (cd; cdi) {
auto a = (cd[0] / 2 + (cd[0] % 2 == 0 ? 0 : 1)) % mod;
auto b = cd[1] % mod;
r = (r + (a * b) % mod) % mod;
}
writeln(r);
}