Submission #969244

#TimeUsernameProblemLanguageResultExecution timeMemory
969244NeltPotatoes and fertilizers (LMIO19_bulves)C++17
24 / 100
60 ms6988 KiB
#include <bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); void solve() { ll n; cin >> n; ll ans = 0, cur = 0; while (n--) { ll a, b; cin >> a >> b; cur += a - b; ans += abs(cur); } cout << ans << endl; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll t = 1; // precomp(); // cin >> t; for (ll cs = 1; cs <= t; cs++) solve(); cerr << "\nTime elapsed: " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\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...