Submission #14312

#TimeUsernameProblemLanguageResultExecution timeMemory
14312dydnjs지능형 기차 2 (KOI11_train2)C++98
16 / 16
0 ms1084 KiB
#include<stdio.h> #include<algorithm> using namespace std; int a, b; int main() { //freopen("input.txt", "r" ,stdin); int sum=0, ret=0; for(int i=0; i<10; i++) { scanf("%d %d", &a, &b); int k = b - a; if(sum < ret+k) { sum = ret+k; } ret+=k; } printf("%d\n", sum); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...