# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
441108 | mosesmayer | Remittance (JOI19_remittance) | C++17 | 463 ms | 44216 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>
#define fi first
#define se second
#define pb push_back
#define int LL
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef vector<int> vi;
const LL LINF = 1e18;
const int mxsz = 1e6 + 5;
int n;
int a[mxsz], b[mxsz];
int d[mxsz];
int32_t main(){
scanf("%lld", &n);
for (int i = 0; i < n; i++)
scanf("%lld %lld", a+i, b+i);
LL dbt = 0, zeroed = 0, topup = 0, neg = 0;
LL totalTopup = 0;
for (int i = 0; i < n; i++){
d[i] = a[i] - b[i];
if (d[i] > 0) topup++, totalTopup += d[i];
else if (d[i] < 0) neg++;
}
#ifdef DEBUG
for (int i = 0; i < n; i++){
cout << i << ": " << d[i] << '\n';
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |