Submission #894821

#TimeUsernameProblemLanguageResultExecution timeMemory
894821Faisal_SaqibFountain Parks (IOI21_parks)C++17
0 / 100
1 ms348 KiB
#include <vector> using namespace std; void build(std::vector<int> u, std::vector<int> v, std::vector<int> a, std::vector<int> b); int construct_roads(std::vector<int> x, std::vector<int> y) { bool pos=1; int n=x.size(); vector<int> u,v,a,b; vector<vector<int>> cp; for(int i=0;i<n;i++) cp.push_back({y[i],x[i],i}); for(int i=0;(i+1)<n;i++) { // go from y[i] to y[i+1] if(cp[i+1][0]-cp[i][0] != 2) return 0; u.push_back(cp[i][2]); v.push_back(cp[i+1][2]); a.push_back(cp[i][1]-1); b.push_back(cp[i][0]-1); } build(u,v,a,b); return 1; }

Compilation message (stderr)

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:6:7: warning: unused variable 'pos' [-Wunused-variable]
    6 |  bool pos=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...