我这个代码为什么超时啊,60分,大佬们帮忙看一下吧 #include <bits/stdc++.h> using namespace std; const int c = 1e9+7; long long a[1000001];

int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } while (n != 1) { for (int i = 1; i <= n; i++) { a[i] = (a[i] * a[i + 1])%c; } n -= 1; } cout << a[1]; return 0; }

0 comments

No comments so far...

Information

ID
87
Time
1000ms
Memory
256MiB
Difficulty
5
Tags
# Submissions
150
Accepted
51
Uploaded By