結果

問題 No.146 試験監督(1)
ユーザー maine_honzuki
提出日時 2020-05-23 23:54:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 343 bytes
コンパイル時間 1,610 ms
コンパイル使用メモリ 167,080 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 13:19:59
合計ジャッジ時間 3,412 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int N;
    ll ans = 0;
    cin >> N;

    while (N--) {
        ll C, D;
        cin >> C >> D;
        (C += 1) /= 2;
        C %= mod;
        D %= mod;
        ans += (C * D) % mod;
        ans %= mod;
    }

    cout << ans << endl;
}
0