結果

問題 No.146 試験監督(1)
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-09-07 14:35:08
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 178 ms / 1,000 ms
コード長 418 bytes
コンパイル時間 934 ms
コンパイル使用メモリ 112,252 KB
実行使用メモリ 31,644 KB
最終ジャッジ日時 2024-04-27 17:05:00
合計ジャッジ時間 2,199 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 178 ms
31,644 KB
testcase_01 AC 178 ms
29,200 KB
testcase_02 AC 178 ms
31,372 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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);
	}
}
0