結果

問題 No.146 試験監督(1)
ユーザー alpha_virginis
提出日時 2015-03-04 17:53:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 137 ms / 1,000 ms
コード長 447 bytes
コンパイル時間 752 ms
コンパイル使用メモリ 66,720 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 01:45:26
合計ジャッジ時間 2,339 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>

int main() {

  int n;
  long t1, t2;
  long ans = 0;
  std::vector<long> v;
  int i;
  
  std::cin >> n;

  for(i = 0; i < n; i++) {
    std::cin >> t1 >> t2;
    v.push_back(((((t1+1)/2)%1000000007) * (t2%1000000007))%1000000007);
  }

  for(i = 0; i < n; i++) {
    ans += v[i];
  }

  std::cout << (ans % 1000000007) << std::endl;

  return 0;
}
0