結果

問題 No.146 試験監督(1)
ユーザー fumi6328fumi6328
提出日時 2018-10-06 11:55:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 134 ms / 1,000 ms
コード長 351 bytes
コンパイル時間 1,490 ms
コンパイル使用メモリ 162,284 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 17:48:38
合計ジャッジ時間 2,535 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
5,248 KB
testcase_01 AC 134 ms
5,376 KB
testcase_02 AC 133 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
const int mod =  1e9+7;
using namespace std;

int main()
{
    int n;
    cin >> n;
    long long c,d,ans = 0;
    for(int i = 0; i < n; i++){
        cin >> c >> d;
        d %= mod;
        ans += (((c + 1) / 2) % mod * d) % mod;
        ans %= mod;
    }

    cout << ans << endl;
       
    return 0;
}
0