Submission #114027

#TimeUsernameProblemLanguageResultExecution timeMemory
114027faustaadpSimurgh (IOI17_simurgh)C++17
0 / 100
2 ms384 KiB
#include "simurgh.h" #include<bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; ll n,m,a[1010101],i; ll cek(ll aa,ll bb) { std::vector<int> tom,tom1,tom2; ll ii,sisa=n-2; for(ii=0;ii<m;ii++) if(ii!=aa&&ii!=bb&&sisa) { tom.pb(ii); sisa--; } tom1=tom; tom2=tom; tom1.pb(aa); tom2.pb(bb); return count_common_roads(tom2)-count_common_roads(tom1); } std::vector<int> find_roads(int N, std::vector<int> u, std::vector<int> v) { n=N; m=u.size(); std::vector<int> r(n - 1); for(int i = 0; i < n - 1; i++) r[i] = i; int common = count_common_roads(r); if(common == n - 1) return r; ll ma=0; for(i=1;i<m;i++) { a[i]=a[i-1]+cek(i-1,i); ma=max(ma,a[i]); } r.clear(); for(i=0;i<m;i++) if(a[i]==ma) r.pb(i); return r; }
#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...