답안 #733376

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
733376 2023-04-30T15:24:56 Z rainboy 지능형 기차 2 (KOI11_train2) C
16 / 16
1 ms 284 KB
#include <stdio.h>

#define N	10

int max(int a, int b) { return a > b ? a : b; }

int main() {
	int i, a, b, c, c_;

	c = 0, c_ = 0;
	for (i = 0; i < N; i++) {
		scanf("%d%d", &a, &b);
		c_ = max(c_, c += b - a);
	}
	printf("%d\n", c_);
	return 0;
}

Compilation message

train.c: In function 'main':
train.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d%d", &a, &b);
      |   ^~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 284 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct