# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
99301 |
2019-03-02T09:19:24 Z |
Mercenary |
ICC (CEOI16_icc) |
C++14 |
|
6 ms |
640 KB |
//#ifndef __GRADER_CPP__
//#define __GRADER_CPP__
//
//#include "graderlib.cpp"
#include "icc.h"
#include <bits/stdc++.h>
const int maxn = 105;
using namespace std;
vector<int> P[maxn];
int papa[maxn];
int Cal(vector<int> a , vector<int> b)
{
int n = a.size();
if(n == 1)return a[0];
vector<int> tmp;
int mid = n / 2;
for(int i = 0 ; i < mid ; ++i)tmp.push_back(a[i]);
if(query(tmp.size(),b.size(),tmp.data(),b.data())){
return Cal(tmp,b);
}
tmp.clear();
for(int i = mid ; i < n ; ++i)tmp.push_back(a[i]);
return Cal(tmp,b);
}
void run(int n)
{
for(int i = 1 ; i <= n ; ++i)P[i].push_back(i) , papa[i] = i;
for(int i = n ; i > 1 ; --i)
{
vector<int> a , b;
for(int j = 0 ; j < 10 ; ++j)
{
for(int k = 1 ; k <= i ; ++k)
{
if((k >> j) & 1)for(int c : P[k])a.push_back(c);
else for(int c : P[k])b.push_back(c);
}
if(query(a.size(),b.size(),a.data(),b.data()))break;
}
int u = Cal(a , b);
int v = Cal(b , a);
setRoad(u,v);
u = papa[u];
v = papa[v];
if(u > v)swap(u,v);
for(int c : P[v])papa[c] = u , P[u].push_back(c);
swap(P[v],P[i]);
}
}
//int main() {
// using namespace ceoi_2016;
// InitGrader();
//
// run(NumVertices());
//
// GraderExitFail();
// printf("SUCCESS");
// return 0;
//}
//
//#endif // __GRADER_CPP__
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
512 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
640 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
512 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
512 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
512 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
512 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |