# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
399559 | ronnith | Potatoes and fertilizers (LMIO19_bulves) | C++14 | 249 ms | 24888 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
struct Line {
long long m, c;
Line() {}
Line(long long mm, long long cc) : m(mm), c(cc) {}
inline long long getY(long long x) { return m*x+c; }
};
const int N = (int)5e5;
int n, a[N], b[N];
long long d[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int i = 0;i < n;i ++) {
cin >> a[i] >> b[i];
d[i] = a[i] - b[i];
if (i != 0) d[i] += d[i - 1];
}
Line line;
priority_queue<long long> pq;
if (d[0] > 0) {
# | 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... |