結果

問題 No.146 試験監督(1)
ユーザー alpha_virginisalpha_virginis
提出日時 2015-03-04 17:53:30
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 447 bytes
コンパイル時間 743 ms
コンパイル使用メモリ 66,800 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 07:05:19
合計ジャッジ時間 1,984 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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