# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320609 | arnold518 | Park (JOI17_park) | C++14 | 263 ms | 512 KiB |
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 "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)
# | 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... |