結果

問題 No.146 試験監督(1)
ユーザー bluemeganebluemegane
提出日時 2018-09-20 19:42:15
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 542 bytes
コンパイル時間 4,802 ms
コンパイル使用メモリ 104,220 KB
実行使用メモリ 26,920 KB
最終ジャッジ日時 2023-09-25 10:35:51
合計ジャッジ時間 3,406 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

using System;

public class Hello
{
    public const int MOD = 1000000007;
    public static void Main()
    {
        var ans = 0L;
        var n = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < n; i++)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var c = long.Parse(line[0]);
            var d = long.Parse(line[1]);
            if (c % 2 == 0) ans += c / 2 * d;
            else ans += (c + 1) / 2 * d;
            ans %= MOD;
        }
        Console.WriteLine(ans);
    }
}
0