Submission #740663

#TimeUsernameProblemLanguageResultExecution timeMemory
740663Prieved1Potatoes and fertilizers (LMIO19_bulves)C++17
24 / 100
270 ms10828 KiB
#include<bits/stdc++.h> using namespace std; int main () { int n; cin >> n; int a[n], b[n]; long long sum=0, move=0; for(int i = 0;i<n;i++) { cin >> a[i] >> b[i]; move+=a[i]; sum+=abs(move-b[i]); move-=b[i]; } cout << sum << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...