Submission #991249

# Submission time Handle Problem Language Result Execution time Memory
991249 2024-06-01T16:04:37 Z VMaksimoski008 Multiplication (BOI24_multiplication) C++17
Compilation error
0 ms 0 KB
#include <iostream>

int main() {
  int n;
  std::cin >> n;
  long long ans = 1;
  
  for(int i=1; i<=n; i++) {
    long long x;
    std::cin >> x;
    ans = (ans * (x % (1e9 + 7))) % (1e9 + 7);
  }
  
  std::cout << ans << '\n';
  return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:11:21: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   11 |     ans = (ans * (x % (1e9 + 7))) % (1e9 + 7);
      |                   ~ ^ ~~~~~~~~~
      |                   |        |
      |                   |        double
      |                   long long int