Submission #826523

#TimeUsernameProblemLanguageResultExecution timeMemory
826523MohamedAhmed04Park (JOI17_park)C++14
10 / 100
137 ms524 KiB
#include <bits/stdc++.h> #include "park.h" using namespace std ; const int MAX = 1400 + 10 ; static int Place[MAX] ; int n ; int deg[MAX] ; vector< vector<int> >adj(MAX) ; bool cmp(int a , int b) { for(int i = 0 ; i < n ; ++i) Place[i] = 1 ; Place[a] = 0 ; return (!Ask(0 , b , Place)) ; //if false then a is ancestor b } void Detect(int T, int N) { n = N ; if(n == 2) { Answer(0 , 1) ; return ; } vector<int>v ; for(int i = 1 ; i < n-1 ; ++i) v.push_back(i) ; sort(v.begin() , v.end() , cmp) ; Answer(0 , v[0]) ; for(int i = 0 ; i+1 < v.size() ; ++i) Answer(min(v[i] , v[i+1]) , max(v[i] , v[i+1])) ; Answer(v.back() , n-1) ; return ; }

Compilation message (stderr)

park.cpp: In function 'void Detect(int, int)':
park.cpp:35:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |  for(int i = 0 ; i+1 < v.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...
#Verdict Execution timeMemoryGrader output
Fetching results...