Submission #1081946

#TimeUsernameProblemLanguageResultExecution timeMemory
1081946ALeonidouFountain Parks (IOI21_parks)C++17
5 / 100
80 ms8832 KiB
#include "parks.h" #include <bits/stdc++.h> using namespace std; #define ll int #define F first #define S second #define pb push_back #define sz(x) (ll)x.size() typedef vector <ll> vi; typedef pair <ll,ll> ii; typedef vector <ii> vii; #define dbg(x) cout<<#x<<": "<<x<<endl; #define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl; #define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl; void printVct(vi &v){ for (ll i =0; i<sz(v); i++){ cout<<v[i]<<" "; } cout<<endl; } int construct_roads(vi x, vi y) { ll n = sz(x); vii yy(n); for (ll i=0; i<n; i++){ yy[i] = ii(y[i], i); } sort(yy.begin(), yy.end()); vi mp(n); for (ll i =0; i<n; i++){ mp[i] = yy[i].S; } sort(y.begin(), y.end()); vi u,v,a,b; for (ll i= 0; i<n-1; i++){ if (y[i] != y[i+1] - 2){ return 0; } u.pb(mp[i]); v.pb(mp[i+1]); a.pb(1); b.pb(y[i]+1); } build(u, v, a, b); return 1; } /* 2 2 2 2 4 */
#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...