# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
697171 |
2023-02-08T17:17:10 Z |
amunduzbaev |
Park (JOI17_park) |
C++17 |
|
28 ms |
420 KB |
#include "park.h"
#include "bits/stdc++.h"
using namespace std;
#ifndef EVAL
#include "grader.cpp"
#endif
mt19937 rng(chrono :: steady_clock :: now().time_since_epoch().count());
static int used[1400];
void Detect(int t, int n){
auto ask = [&](int a, int b, vector<int> t){
for(auto x : t) used[x] = 1;
if(a > b) swap(a, b);
int ans = Ask(a, b, used);
for(auto x : t) used[x] = 0;
return ans;
};
auto Ans = [&](int i, int j){
if(i > j) swap(i, j);
Answer(i, j);
};
vector<int> p(n);
iota(p.begin(), p.end(), 0);
shuffle(p.begin(), p.end(), rng);
for(int i=0;i<n;i++){
for(int j=0;j<i;j++){
if(ask(p[i], p[j], {p[i], p[j]})){
Ans(p[i], p[j]);
}
}
}
return;
}
/*
1
6
7
0 1
0 3
1 2
1 4
2 4
2 5
3 4
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
312 KB |
Output is correct |
3 |
Correct |
6 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
340 KB |
Output is correct |
5 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
400 KB |
Wrong Answer[5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
340 KB |
Wrong Answer[5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
20 ms |
400 KB |
Wrong Answer[5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
420 KB |
Wrong Answer[5] |
2 |
Halted |
0 ms |
0 KB |
- |