Submission #5043

#TimeUsernameProblemLanguageResultExecution timeMemory
5043jspark19990205지능형 기차 2 (KOI11_train2)C++98
0 / 16
0 ms1088 KiB
#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;
}
#Verdict Execution timeMemoryGrader output
Fetching results...