# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
623198 | Hanksburger | 분수 공원 (IOI21_parks) | C++17 | 547 ms | 69752 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 "parks.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200005], X, Y, U, V, A, B;
vector<pair<int, int> > edge;
map<pair<int, int>, bool> mp;
map<pair<int, int>, int> p;
bool visited[200005];
queue<int> q;
bool cmp(pair<int, int> u, pair<int, int> v)
{
if (X[u.first]!=X[v.first] || X[u.second]!=X[v.second])
return (X[u.first]<X[v.first] || X[u.second]<X[v.second]);
return Y[u.first]<Y[v.first];
}
int construct_roads(vector<int> x, vector<int> y)
{
int N=x.size();
for (int i=0; i<N; i++)
{
X.push_back(x[i]);
Y.push_back(y[i]);
p[{X[i], Y[i]}]=i+1;
}
for (auto itr=p.begin(); itr!=p.end(); itr++)
{
int ind=itr->second-1;
if (p.count({X[ind]-2, Y[ind]}))
edge.push_back({p[{X[ind]-2, Y[ind]}]-1, ind});
if (p.count({X[ind], Y[ind]-2}))
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |