結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-07 14:35:08 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 181 ms / 1,000 ms |
| コード長 | 418 bytes |
| コンパイル時間 | 1,005 ms |
| コンパイル使用メモリ | 106,624 KB |
| 実行使用メモリ | 23,168 KB |
| 最終ジャッジ日時 | 2024-11-15 21:03:47 |
| 合計ジャッジ時間 | 2,311 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
public class Program
{
public static void Main()
{
long mod = (long)1e9 + 7;
int N = int.Parse(Console.ReadLine());
long ans = 0;
for (int i = 0; i < N; i++)
{
var CD = Console.ReadLine().Split().Select(j => long.Parse(j)).ToArray();
long C = CD[0], D = CD[1];
C = (C + 1) / 2 % mod;
D %= mod;
ans += C * D;
ans %= mod;
}
Console.WriteLine(ans);
}
}