Submission #991249

#TimeUsernameProblemLanguageResultExecution timeMemory
991249VMaksimoski008Multiplication (BOI24_multiplication)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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