제출 #759467

#제출 시각아이디문제언어결과실행 시간메모리
759467drdilyor분수 공원 (IOI21_parks)C++17
5 / 100
47 ms7860 KiB
#include "parks.h" #include<bits/stdc++.h> using namespace std; int construct_roads(std::vector<int> x, std::vector<int> y) { if (x.size() == 1) { build({}, {}, {}, {}); return 1; } int n = x.size(); std::vector<int> u, v, a, b; vector<int> ix(n); iota(ix.begin(), ix.end(), 0); sort(ix.begin(), ix.end(), [&](int a, int b) { return y[a] < y[b]; }); for (int i = 1; i <n; i++) { u.push_back(ix[i-1]); v.push_back(ix[i]); a.push_back(1); b.push_back(y[ix[i]]-1); if (i && y[ix[i]] != y[ix[i-1]]+2) 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...