Submission #740082

#TimeUsernameProblemLanguageResultExecution timeMemory
740082vjudge1Fountain Parks (IOI21_parks)C++17
0 / 100
17 ms4788 KiB
#include "parks.h" #include<bits/stdc++.h> using namespace std; const int maxn = 2e5 + 100; int ord[maxn]; int construct_roads(std::vector<int> x, std::vector<int> y){ int n=x.size(); if (x.size() == 1) { build({}, {}, {}, {}); return 1; } for(int i=0; i<n; i++){ ord[i] = i; } // sort(ord, ord+n, [](int a, int b){ // return y[a] < y[b]; // }); bool ok = 1; vector<int>u, v, a, b; for(int i=1; i<n; i++){ if(y[i]-y[i-1] != 2) ok = 0; u.push_back(ord[i-1]); v.push_back(ord[i]); a.push_back(1); b.push_back(y[ord[i]]-1); } if(ok) build(u, v, a, b); return ok; }
#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...