結果

問題 No.146 試験監督(1)
ユーザー alcheminalchemin
提出日時 2019-09-25 14:44:47
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 355 bytes
コンパイル時間 1,355 ms
コンパイル使用メモリ 166,200 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 04:45:33
合計ジャッジ時間 2,683 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    int md = 1000000007;
    
    cin >> n;
    
    long long c, d, ans = 0;
    for (int i = 0; i < n; i++) {
        cin >> c >> d;
        ans += (((c + 1) / 2) % md) * (d % md);
        ans = ans % md;
    }
    
    cout << setprecision(20) << ans << endl;
    
    return 0;
}
0