Submission #106169

# Submission time Handle Problem Language Result Execution time Memory
106169 2019-04-17T01:03:06 Z parkj2180 지능형 기차 2 (KOI11_train2) C++14
16 / 16
3 ms 384 KB
#include<stdio.h>
int main() {
	int sum=0, max = 0;
	for (int i = 0; i < 10; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		sum = sum - a + b;
		if (max < sum) max = sum;
	}
	printf("%d", max);
}

Compilation message

train.cpp: In function 'int main()':
train.cpp:6:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &a, &b);
   ~~~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 3 ms 384 KB Output is correct
10 Correct 2 ms 384 KB Output is correct