fork download
  1. #include <bits/stdc++.h>
  2. #define int long long
  3. using namespace std;
  4.  
  5. const int MOD = 1e9 + 7;
  6. int a[100005];
  7.  
  8. int32_t main() {
  9. int n; cin >> n;
  10. for(int i = 1; i <= n; ++ i) cin >> a[i];
  11.  
  12. int ans = 1;
  13. for(int i = 1; i <= n; ++ i) {
  14. ans *= a[i];
  15. ans %= MOD;
  16. }
  17. cout << ans;
  18. }
Time limit exceeded #stdin #stdout 5s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty