Submission #320609

#TimeUsernameProblemLanguageResultExecution timeMemory
320609arnold518Park (JOI17_park)C++14
0 / 100
263 ms512 KiB
#include "park.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 1500; int T, N; int P[MAXN+10]; int query(int A, int B) { return Ask(A, B, P); } void Detect(int _T, int _N) { T=_T; N=_N; for(int i=0; i<N; i++) P[i]=1; vector<int> V; for(int i=1; i<N-1; i++) V.push_back(i); sort(V.begin(), V.end(), [&](const int &p, const int &q) { P[p]=0; int t=query(0, q); P[p]=1; return !t; }); Answer(0, V.front()); for(int i=0; i+1<V.size(); i++) Answer(V[i], V[i+1]); Answer(V.back(), N-1); }

Compilation message (stderr)

park.cpp: In function 'void Detect(int, int)':
park.cpp:36:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |  for(int i=0; i+1<V.size(); i++) Answer(V[i], V[i+1]);
      |               ~~~^~~~~~~~~
#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...