제출 #978475

#제출 시각아이디문제언어결과실행 시간메모리
978475happy_nodeMeetings (JOI19_meetings)C++17
29 / 100
1773 ms1576 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; const int MX=2005; vector<pair<int,int>> edges; bool vis[MX]; void dfs(int root, vector<int> v) { if(v.size()==1) { return; } vector<int> curRoot; vector<vector<int>> items; for(auto u:v) { if(u==root) continue; if(vis[u]) continue; int pt=0; for(auto r:curRoot) { // at this subtree int q=Query(root,r,u); if(q==root) { // not at this subtree pt++; continue; } // at this subtree curRoot[pt]=q; if(!vis[q]) items[pt].push_back(q); vis[q]=true; if(!vis[u]) items[pt].push_back(u); vis[u]=true; break; } if(!vis[u]) { vis[u]=true; curRoot.push_back(u); items.push_back({u}); } } for(auto u:v) { vis[u]=false; } int pt=0, sum=1; for(auto r:curRoot) { edges.push_back({root,r}); sum+=items[pt].size(); dfs(r,items[pt]); pt++; } assert(sum==v.size()); } void Solve(int N) { vector<int> v; for(int i=0;i<N;i++) v.push_back(i); dfs(0,v); for(auto [u,v]:edges) { if(u>v) swap(u,v); Bridge(u,v); } }

컴파일 시 표준 에러 (stderr) 메시지

In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from meetings.cpp:2:
meetings.cpp: In function 'void dfs(int, std::vector<int>)':
meetings.cpp:60:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |         assert(sum==v.size());
      |                ~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...