# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
773274 | Sami_Massah | Coin Collecting (JOI19_ho_t4) | C++17 | 72 ms | 15380 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;
const long long maxn = 2e5 + 12, mod = 1e9 + 7;
long long n, a[3][maxn], x[maxn], y[maxn];
set <int> Q[3];
int main(){
ios_base::sync_with_stdio(false), cin.tie(0);
cin >> n;
for(int i = 0; i < 2 * n; i++)
cin >> x[i] >> y[i];
long long d = 0;
for(int i = 0; i < 2 * n; i++){
if(y[i] < 1 || 2 < y[i]){
if(y[i] < 1){
d += 1 - y[i];
y[i] = 1;
}
else{
d += y[i] - 2;
y[i] = 2;
}
}
if(x[i] < 1 || n < x[i]){
if(x[i] < 1){
d += 1 - x[i];
x[i] = 1;
}
else{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |