結果

問題 No.146 試験監督(1)
ユーザー test
提出日時 2020-09-16 08:26:39
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 432 bytes
コンパイル時間 1,647 ms
コンパイル使用メモリ 191,844 KB
最終ジャッジ日時 2025-01-14 15:12:48
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, ss, ee) for (int i = ss; i < ee; ++i)
using namespace std;
using ull = unsigned long long;
const ull MOD = 1e9 + 7;

void solve() {
  ull N, c, d, ans = 0;
  cin >> N;

  rep(i, 0, N) {
    cin >> c >> d;
    ans = ((ans % MOD) + (((c + 1) / 2 % MOD) * (d % MOD)) % MOD) % MOD;
  }

  cout << ans << endl;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  getchar();
}
0