Submission #935073

#TimeUsernameProblemLanguageResultExecution timeMemory
935073Onur_IlgazPotatoes and fertilizers (LMIO19_bulves)C++17
24 / 100
60 ms6996 KiB
#include <bits/stdc++.h> #define fast cin.tie(0)->sync_with_stdio(0); #define int long long #define inf ((int)1e18) using namespace std; int32_t main(){ fast int n; cin >> n; int need = 0, ans = 0; for(int i = 0; i < n; i++) { int a, b; cin >> a >> b; int ai = b - a; need += ai; ans += abs(need); } cout << ans << "\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...