結果

問題 No.146 試験監督(1)
ユーザー yansi819
提出日時 2024-04-01 11:09:30
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 168 ms / 1,000 ms
コード長 445 bytes
コンパイル時間 4,228 ms
コンパイル使用メモリ 251,692 KB
最終ジャッジ日時 2025-02-20 18:48:54
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;

ll N, C, D, ans;
ll mod = 1000000007;

int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> C >> D;
    if (C % 2 == 1) ans = (ans + ((((C + 1) / 2) % mod) * (D % mod)) % mod) % mod;
    else ans = (ans + (((C / 2) % mod) * (D % mod)) % mod) % mod;
  }
  cout << ans << endl;
  return 0;
}
0