結果

問題 No.146 試験監督(1)
ユーザー Kaz_nlKaz_nl
提出日時 2017-08-30 22:17:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 276 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 54,104 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 07:22:10
合計ジャッジ時間 1,340 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
constexpr int MOD = 1000000007;

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