제출 #120396

#제출 시각아이디문제언어결과실행 시간메모리
120396pavelMeetings (JOI19_meetings)C++14
29 / 100
2106 ms1884 KiB
#include <vector> #include <map> #include <algorithm> #include "meetings.h" using namespace std; struct cmp{ int a; cmp(int b){ a=b; } bool operator()(int x, int y){ if(x==a) return y!=a; if(y==a) return false; return Query(a, x, y)==x; } }; void SolveSubTree(vector<int> nodes){ if(nodes.size()<=1) return; int a=nodes[0], b=nodes[1]; map<int, vector<int>> sts; sts[a].push_back(a); sts[b].push_back(b); for(int j=2;j<nodes.size();++j){ int x = Query(a, b, nodes[j]); sts[x].push_back(nodes[j]); } vector<int> path; for(auto i:sts){ path.push_back(i.first); } sort(path.begin(), path.end(), cmp(a)); for(int i=1;i<path.size();++i){ int x=min(path[i-1], path[i]); int y=max(path[i-1], path[i]); Bridge(x, y); } for(auto i:sts){ SolveSubTree(i.second); } } void Solve(int N) { vector<int> s; for(int i=0;i<N;++i) s.push_back(i); SolveSubTree(s); }

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

meetings.cpp: In function 'void SolveSubTree(std::vector<int>)':
meetings.cpp:28:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j=2;j<nodes.size();++j){
                 ~^~~~~~~~~~~~~
meetings.cpp:39:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=1;i<path.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...