#include <cstdio>
int main()
{
int n,i=0;
int max = -1;
bool np = false;
while(scanf("%d",&i)==1)
{
if(np)
{
n +=i;
}
else
{
n -=1;
}
if (max <n)
{
max = n;
}
np = !np;
}
printf("%d\n",max);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |