結果

問題 No.146 試験監督(1)
ユーザー suibaka_kusuibaka_ku
提出日時 2017-03-08 10:22:53
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 406 bytes
コンパイル時間 669 ms
コンパイル使用メモリ 77,688 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-06 01:50:21
合計ジャッジ時間 1,755 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
using ll = long long;
constexpr ll M = 1e9+7;

int main() {
    ll N;
    cin >> N;
    ll res = 0;
    for(int i=0; i<N; ++i) {
        ll c, d;
        cin >> c >> d;
        d %= M;
        res += (((c+1)/2) % M) * d;
        res %= M;
    }
    cout << res << endl;
}
0