답안 #4604

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
4604 2013-11-10T02:51:00 Z Namnamseo 지능형 기차 2 (KOI11_train2) C++
16 / 16
0 ms 1088 KB
#include <stdio.h>
 
int max(int x,int y)
{
  return (x>y)?x:y;
}
 
int main(int a,char** b)
{
  int x=0;
  int p,q;
  int ans=-1;
  for(a=10;a>0;a--)
  {
    scanf("%d %d",&p,&q);
    x+=q-p; ans=max(ans,x);
  }
  printf("%d",ans);
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Correct 0 ms 1088 KB Output is correct
7 Correct 0 ms 1088 KB Output is correct
8 Correct 0 ms 1088 KB Output is correct
9 Correct 0 ms 1088 KB Output is correct
10 Correct 0 ms 1088 KB Output is correct