Submission #440407

#TimeUsernameProblemLanguageResultExecution timeMemory
440407antontsiorvasFountain Parks (IOI21_parks)C++17
5 / 100
81 ms7480 KiB
#include "parks.h" #include <cstdio> #include <algorithm> int fount[200005]; int sy[200005]; bool compare(int a, int b){ return sy[a] < sy[b]; } int construct_roads(std::vector<int> x, std::vector<int> y) { if (x.size() == 1) { build({}, {}, {}, {}); return 1; } int n = x.size(); for(int i=0; i<n; i++){ fount[i] = i; sy[i] = y[i]; } std::sort(&fount[0],&fount[n],compare); std::sort(&sy[0],&sy[n]); std::vector<int> u, v, a, b; for(int i=0; i<n-1; i++){ if(sy[i+1]-sy[i] != 2) return 0; u.push_back(fount[i]); v.push_back(fount[i+1]); a.push_back(1); b.push_back(sy[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...