Submission #262125

#TimeUsernameProblemLanguageResultExecution timeMemory
262125dooweyMeetings (JOI19_meetings)C++14
29 / 100
3094 ms512 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n; const int MAXN = 2020; int par[MAXN]; bool comp(int u, int v){ if(Query(0,u,v) == u) return true; else return false; } bool use[MAXN]; bool ban[MAXN]; void Solve(int N) { n = N; vector<int> ord; for(int i = 1; i < n ; i ++ ){ ord.push_back(i); par[i] = -1; } random_shuffle(ord.begin(), ord.end()); int fir; for(auto nd : ord){ if(par[nd] != -1) continue; int res; for(int j = 0 ; j < n; j ++ ){ use[j]=false; ban[j]=false; } for(int j = 1; j < n; j ++ ){ if(j == nd) continue; res = Query(0, j, nd); use[res]=true; } use[nd]=true; use[0]=true; fir = 0; for(int j = 1; j < n; j ++ ){ if(!use[j]) continue; if(par[j] != -1){ if(use[par[j]]){ ban[par[j]]=true; } } } vector<int> ss; for(int j = 1; j < n; j ++ ){ if(use[j] && par[j] != -1 && ban[j] == false){ fir = j; } else if(use[j] && !ban[j]){ ss.push_back(j); } } sort(ss.begin(), ss.end(), comp); par[ss[0]] = fir; for(int i = 1; i < ss.size(); i ++ ) par[ss[i]] = ss[i - 1]; } int l, r; for(int i = 1; i < n; i ++ ){ l = par[i]; r = i; if(l > r) swap(l, r); Bridge(l, r); } }

Compilation message (stderr)

meetings.cpp: In function 'void Solve(int)':
meetings.cpp:69:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   69 |         for(int i = 1; i < ss.size(); i ++ )
      |                        ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...