# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
29007 |
2017-07-18T05:50:07 Z |
상수시러(#1235) |
Park (JOI17_park) |
C++11 |
|
209 ms |
2116 KB |
#include "park.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>
using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define pii Pi
#define pll PL
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> PL;
typedef long double ldouble;
static int place[1400];
int N;
void myAnswer(int x, int y) {
if(x > y) swap(x, y);
Answer(x, y);
}
void Do_2(vector <int> &V) {
int x = V[0];
vector <int> w[2];
for(int i=1;i<sz(V);i++) {
rep(k, N) place[k] = 1;
place[V[i]] = 0;
int t = Ask(0, x, place);
w[t].pb(V[i]);
}
if(sz(w[0])) {
Do_2(w[0]);
myAnswer(w[0].back(), x);
}
if(sz(w[1])) {
Do_2(w[1]);
myAnswer(x, w[1][0]);
}
V.clear();
for(int e : w[0]) V.pb(e);
V.pb(x);
for(int e : w[1]) V.pb(e);
}
void Detect(int T, int n) {
N = n;
if(N == 2) Answer(1, 2);
else if(T == 1) {
rep(j, N) rep(i, j) {
rep(k, N) place[k] = 0;
place[i] = place[j] = 1;
if(Ask(i, j, place)) Answer(i, j);
}
}
else if(T == 2) {
vector <int> v;
for(int i=1;i<N-1;i++) v.pb(i);
random_shuffle(all(v));
Do_2(v);
myAnswer(0, v[0]);
myAnswer(v.back(), N - 1);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2116 KB |
Output is correct |
2 |
Correct |
9 ms |
2116 KB |
Output is correct |
3 |
Correct |
9 ms |
2116 KB |
Output is correct |
4 |
Correct |
9 ms |
2116 KB |
Output is correct |
5 |
Correct |
9 ms |
2116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
193 ms |
2116 KB |
Output is correct |
2 |
Correct |
129 ms |
2116 KB |
Output is correct |
3 |
Correct |
139 ms |
2116 KB |
Output is correct |
4 |
Correct |
209 ms |
2116 KB |
Output is correct |
5 |
Correct |
203 ms |
2116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2116 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2116 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2116 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |