Submission #1039802

#TimeUsernameProblemLanguageResultExecution timeMemory
1039802vjudge1Fountain Parks (IOI21_parks)C++17
5 / 100
45 ms9032 KiB
#include "parks.h" #include <bits/stdc++.h> using namespace std; int construct_roads(std::vector<int> x, std::vector<int> y) { vector<pair<pair<int,int>, int>> p; int n = x.size(); for(int i = 0;i<n;i++) { p.push_back({{y[i], x[i]}, i}); } sort(p.begin(), p.end()); vector<int> u, v, a, b; for(int i = 1;i<n;i++) { if(p[i].first.first == p[i-1].first.first+2) { u.push_back(p[i-1].second); v.push_back(p[i].second); a.push_back(p[i].first.second+1); b.push_back(p[i].first.first-1); } else { return 0; } } build(u, v, a, b); return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...