結果

問題 No.146 試験監督(1)
ユーザー ldsybldsyb
提出日時 2016-02-29 17:34:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 310 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 55,744 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 19:10:45
合計ジャッジ時間 1,497 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
   const long long mod = 1e9 + 7;
   int n;
   cin >> n;
   unsigned long long ans = 0,c,d;
   for(int i = 0;i < n;i++){
      cin >> c >> d;
      c = (c + 1) / 2 % mod;
      d %= mod;
      ans += c * d;
      ans %= mod;
   }
   cout << ans << endl;
}
0