結果

問題 No.146 試験監督(1)
ユーザー akichiakichi
提出日時 2017-08-13 14:03:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 153 ms / 1,000 ms
コード長 487 bytes
コンパイル時間 980 ms
コンパイル使用メモリ 112,064 KB
実行使用メモリ 31,372 KB
最終ジャッジ日時 2024-04-21 10:16:47
合計ジャッジ時間 2,645 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
28,944 KB
testcase_01 AC 148 ms
31,372 KB
testcase_02 AC 153 ms
31,120 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;
class Program {
    static void Main() {
        long ans = 0;
        int n = int.Parse(Console.ReadLine());
        long mod = (long)1e9 + 7;
        for (int i = 0; i < n; i++) {
            long[] cd = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            long cm = (cd[0] + 1) / 2 % mod;
            long dm = cd[1] % mod;
            ans += cm * dm % mod;
            ans %= mod;
        }
        Console.WriteLine(ans);
    }
}
0