# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
99307 |
2019-03-02T09:45:16 Z |
Mercenary |
ICC (CEOI16_icc) |
C++14 |
|
98 ms |
888 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)
{
assert(a.size() > 0);
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)
{
a.clear();b.clear();
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(a.size() == 0 || b.size() == 0)continue;
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);
for(int c : P[i])papa[c] = v;
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 |
10 ms |
640 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
640 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
38 ms |
512 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
60 ms |
888 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
98 ms |
632 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
36 ms |
560 KB |
The query sets must be disjoint |
2 |
Halted |
0 ms |
0 KB |
- |