Submission #3160

#TimeUsernameProblemLanguageResultExecution timeMemory
3160kipa00지능형 기차 2 (KOI11_train2)C++98
12.80 / 16
0 ms1088 KiB
#include <cstdio> int main() { int i, n = 0, max = -1; bool nowplus = true; scanf("%d", &i); do { scanf("%d", &i); if (nowplus) { n += i; } else { n -= i; } if (max < n) { max = n; } nowplus = !nowplus; } while (n); printf("%d\n", max); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...