Submission #796283

#TimeUsernameProblemLanguageResultExecution timeMemory
796283t6twotwoFountain Parks (IOI21_parks)C++17
5 / 100
47 ms7112 KiB
#include "parks.h" #include <bits/stdc++.h> using namespace std; using ll = long long; int construct_roads(vector<int> X, vector<int> Y) { int N = X.size(); vector<int> ord(N); iota(ord.begin(), ord.end(), 0); sort(ord.begin(), ord.end(), [&](int i, int j) { return Y[i] < Y[j]; }); vector<int> u, v, a, b; for (int i = 0; i < N - 1; i++) { if (Y[ord[i]] + 2 != Y[ord[i + 1]]) { return 0; } u.push_back(ord[i]); v.push_back(ord[i + 1]); a.push_back(1); b.push_back(Y[ord[i]] + 1); } 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...