結果

問題 No.146 試験監督(1)
ユーザー m1025o1184tm1025o1184t
提出日時 2019-12-03 14:15:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 1,437 ms
コンパイル使用メモリ 166,656 KB
実行使用メモリ 4,868 KB
最終ジャッジ日時 2023-08-18 03:38:41
合計ジャッジ時間 2,526 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll mod = 1000000007;
  int n;
  cin >> n;
  vector<ll> c(n);
  vector<ll> d(n);
  rep(i,n){
  	cin >> c[i] >> d[i];
  }
  ll ans=0;
  rep(i,n){
  	ll k;
  	if(c[i] % 2 == 0) k = c[i] / 2;
  	else k = (c[i] + 1) / 2;
  	ans += k * d[i];
  	ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
0