This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |