Submission #733376

#TimeUsernameProblemLanguageResultExecution timeMemory
733376rainboy지능형 기차 2 (KOI11_train2)C11
16 / 16
1 ms284 KiB
#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 (stderr)

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);
      |   ^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...