# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
477248 |
2021-10-01T11:38:47 Z |
niloyroot |
Feast (NOI19_feast) |
C++14 |
|
43 ms |
3368 KB |
#include <bits/stdc++.h>
using namespace std;
#define forp(i,a,b) for(int i=a;i<=b;i++)
#define ll long long
#define newl '\n'
void solve(){
ll n,k; cin>>n>>k;
ll ans=0,temp=0,c;
forp(i,1,n){
cin>>c;
temp=max(temp+c,c);
ans=max(ans,temp);
}
cout<<ans<<newl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
204 KB |
Output is correct |
2 |
Correct |
35 ms |
288 KB |
Output is correct |
3 |
Correct |
31 ms |
204 KB |
Output is correct |
4 |
Correct |
30 ms |
204 KB |
Output is correct |
5 |
Correct |
35 ms |
296 KB |
Output is correct |
6 |
Correct |
43 ms |
204 KB |
Output is correct |
7 |
Correct |
30 ms |
204 KB |
Output is correct |
8 |
Correct |
38 ms |
204 KB |
Output is correct |
9 |
Correct |
30 ms |
204 KB |
Output is correct |
10 |
Correct |
35 ms |
292 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
204 KB |
Output is correct |
2 |
Correct |
29 ms |
320 KB |
Output is correct |
3 |
Correct |
19 ms |
308 KB |
Output is correct |
4 |
Incorrect |
26 ms |
304 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
292 KB |
Output is correct |
2 |
Correct |
41 ms |
3244 KB |
Output is correct |
3 |
Correct |
35 ms |
3260 KB |
Output is correct |
4 |
Correct |
34 ms |
3232 KB |
Output is correct |
5 |
Correct |
36 ms |
3368 KB |
Output is correct |
6 |
Correct |
34 ms |
3252 KB |
Output is correct |
7 |
Correct |
35 ms |
3228 KB |
Output is correct |
8 |
Correct |
38 ms |
3228 KB |
Output is correct |
9 |
Correct |
38 ms |
3276 KB |
Output is correct |
10 |
Correct |
36 ms |
3252 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
204 KB |
Output is correct |
2 |
Correct |
35 ms |
288 KB |
Output is correct |
3 |
Correct |
31 ms |
204 KB |
Output is correct |
4 |
Correct |
30 ms |
204 KB |
Output is correct |
5 |
Correct |
35 ms |
296 KB |
Output is correct |
6 |
Correct |
43 ms |
204 KB |
Output is correct |
7 |
Correct |
30 ms |
204 KB |
Output is correct |
8 |
Correct |
38 ms |
204 KB |
Output is correct |
9 |
Correct |
30 ms |
204 KB |
Output is correct |
10 |
Correct |
35 ms |
292 KB |
Output is correct |
11 |
Correct |
21 ms |
204 KB |
Output is correct |
12 |
Correct |
29 ms |
320 KB |
Output is correct |
13 |
Correct |
19 ms |
308 KB |
Output is correct |
14 |
Incorrect |
26 ms |
304 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |