Submission #1066100

#TimeUsernameProblemLanguageResultExecution timeMemory
1066100AndreyMeetings (JOI19_meetings)C++14
29 / 100
1054 ms1436 KiB
#include "meetings.h" #include<bits/stdc++.h> using namespace std; mt19937 rng(69420); vector<pair<int,int>> ans(0); void dude(vector<int> haha) { if(haha.size() == 1) { return; } if(haha.size() == 2) { ans.push_back({haha[0],haha[1]}); return; } int p = rng()%haha.size(); vector<vector<int>> idk(0); vector<int> troll(0); for(int i = 0; i < haha.size(); i++) { if(i != p) { bool yeah = true; for(int j = 0; j < troll.size(); j++) { if(troll[j] == haha[i]) { yeah = false; idk[j].push_back(haha[i]); break; } else { int c = Query(haha[p],troll[j],haha[i]); if(c != haha[p]) { yeah = false; idk[j].push_back(haha[i]); troll[j] = c; break; } } } if(yeah) { idk.push_back({haha[i]}); troll.push_back(haha[i]); } } } for(int i = 0; i < idk.size(); i++) { ans.push_back({haha[p],troll[i]}); dude(idk[i]); } } void Solve(int n) { vector<int> haha(0); for(int i = 0; i < n; i++) { haha.push_back(i); } dude(haha); for(int i = 0; i < ans.size(); i++) { Bridge(min(ans[i].first,ans[i].second),max(ans[i].first,ans[i].second)); } }

Compilation message (stderr)

meetings.cpp: In function 'void dude(std::vector<int>)':
meetings.cpp:19:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for(int i = 0; i < haha.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
meetings.cpp:22:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |             for(int j = 0; j < troll.size(); j++) {
      |                            ~~^~~~~~~~~~~~~~
meetings.cpp:44:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |     for(int i = 0; i < idk.size(); i++) {
      |                    ~~^~~~~~~~~~~~
meetings.cpp: In function 'void Solve(int)':
meetings.cpp:56:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 |     for(int i = 0; i < ans.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...