# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
704307 |
2023-03-02T03:22:00 Z |
Hiennoob123 |
Park (JOI17_park) |
C++14 |
|
10 ms |
348 KB |
#include "park.h"
#include <bits/stdc++.h>
#define ll int
#define ld long double
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
const ll maxn = 1405;
static int Place[1400];
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll random(ll l ,ll r)
{
ll x = rng();
return (abs(x)%(r-l+1)+l);
}
ll t, n;
vector<pll> Edge;
ll par[maxn];
ll find_par(ll v)
{
if(v==par[v]) return v;
else return par[v] = find_par(par[v]);
}
bool mid(ll a, ll b, ll c)
{
if(a>c) swap(a, c);
//cout << a << " " << b << " " << c << "\n";
for(int i = 0; i< n; i++) Place[i] = 1;
Place[b] = 0;
return !Ask(a, c, Place);
}
bool adj(ll a, ll b)
{
if(a>b) swap(a, b);
//cout << a << " " << b << "\n";
for(int i = 0; i< n; i++) Place[i] = 0;
Place[a] = Place[b] = 1;
return Ask(a, b, Place);
}
void Answ()
{
for(auto u: Edge)
{
if(u.fi>u.se) swap(u.fi, u.se);
//cout << u.fi << " " << u.se << "\n";
Answer(u.fi, u.se);
}
}
namespace task1
{
void solve()
{
for(int i = 0; i< n; i++)
{
for(int j = i+1; j< n; j++)
{
if(adj(i, j)) Edge.push_back(mp(i, j));
}
}
Answ();
}
}
namespace task2
{
}
void Detect(int xaa, int xa) {
t = xaa; n = xa;
if(t==1) task1::solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
7 ms |
348 KB |
Output is correct |
3 |
Correct |
10 ms |
340 KB |
Output is correct |
4 |
Correct |
7 ms |
340 KB |
Output is correct |
5 |
Correct |
8 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |