#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e6 + 11;
int a[N];
int32_t main(){
cin.tie(0); cout.tie(0)->sync_with_stdio(false);
int n; cin >> n;
for(int i = 0; i < n; i++) cin >> a[i];
for(int i = 1; i < n; i++) a[i] = max(a[i - 1], a[i]);
cout << n * a[0] << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
123 ms |
14604 KB |
Output is correct |
2 |
Correct |
97 ms |
17740 KB |
Output is correct |
3 |
Correct |
113 ms |
17772 KB |
Output is correct |
4 |
Correct |
107 ms |
17720 KB |
Output is correct |
5 |
Correct |
107 ms |
17812 KB |
Output is correct |
6 |
Correct |
102 ms |
17760 KB |
Output is correct |
7 |
Correct |
125 ms |
17740 KB |
Output is correct |
8 |
Correct |
97 ms |
17740 KB |
Output is correct |
9 |
Correct |
97 ms |
17872 KB |
Output is correct |
10 |
Correct |
101 ms |
17776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |