답안 #106319

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
106319 2019-04-17T21:13:17 Z xiaowuc1 Σ (kriii4_P2) C++14
컴파일 오류
0 ms 0 KB
#include <algorithm>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> plli;
typedef vector<vector<ll>> matrix;

ll modpow(ll b, ll e, ll m) {
  ll r = 1;
  b %= m;
  while(e) {
    if(e%2) {
      r*=b;
      r%=m;
    }
    b*=b;
    b%=m;
    e/=2;
  }
  return r;
}
void solve() {
  int n;
  cin >> n;
  ll ret = 0;
  while(n--) {
    int a, b;
    cin >> a >> b;
    ret += b * (a, 1e9 + 5, 1e9+7);
    ret %= 1e9+7;
  }
  cout << ret << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
	/*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
	*/
	solve();
}

Compilation message

P2.cpp: In function 'void solve()':
P2.cpp:40:26: warning: left operand of comma operator has no effect [-Wunused-value]
     ret += b * (a, 1e9 + 5, 1e9+7);
                          ^
P2.cpp:40:24: warning: right operand of comma operator has no effect [-Wunused-value]
     ret += b * (a, 1e9 + 5, 1e9+7);
                    ~~~~^~~
P2.cpp:41:9: error: invalid operands of types 'll {aka long long int}' and 'double' to binary 'operator%'
     ret %= 1e9+7;
     ~~~~^~~~~~~~
P2.cpp:41:16: error:   in evaluation of 'operator%=(ll {aka long long int}, double)'
     ret %= 1e9+7;
                ^