# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1135953 | MateiKing80 | Potatoes and fertilizers (LMIO19_bulves) | C++20 | 219 ms | 12468 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
int n;
cin >> n;
vector<ll> a(n), b(n);
for(int i = 0; i < n; i ++)
cin >> a[i] >> b[i];
ll c = 0;
for(int i = 0; i < n; i ++)
c += a[i] - b[i];
ll cost = 0;
priority_queue<ll> pq;
ll d = 0;
for(int i = 0; i < n; i ++)
{
d += a[i] - b[i];
ll e = d;
if(e < 0)
{
cost -= e;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |