# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
58574 |
2018-07-18T08:56:11 Z |
Mamnoon_Siam |
ICC (CEOI16_icc) |
C++17 |
|
349 ms |
856 KB |
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int n;
int ok[maxn][maxn];
int ask(vector<int> x, vector<int> y) {
int size_a = x.size(), size_b = y.size();
int a[size_a], b[size_b];
for(int i = 0; i < size_a; i++) a[i] = x[i];
for(int i = 0; i < size_b; i++) b[i] = y[i];
return query(size_a, size_b, a, b);
}
int chex(int u) {
vector<int> a = {u}, b;
for(int i = 1; i <= n; i++) {
if(i != u and !ok[u][i]) {
b.push_back(i);
}
}
if(b.empty()) return 0;
return ask(a, b);
}
int find_another(int u) {
for(int i = 1; i <= n; i++) {
if(i != u and !ok[u][i]) {
if(ask({u}, {i})) {
return i;
}
}
} assert(false);
}
void run(int N) {
memset(ok, 0, sizeof ok);
n = N;
int rnd = n - 1;
while(rnd--) {
int u = 0;
for(int i = 1; i <= n; i++)
if(chex(i)) { u = i; break; }
int v = find_another(u);
setRoad(u, v);
ok[u][v] = ok[v][u] = 1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
504 KB |
Ok! 301 queries used. |
2 |
Incorrect |
21 ms |
744 KB |
Wrong road! |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
744 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
254 ms |
744 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
286 ms |
744 KB |
Wrong road! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
349 ms |
744 KB |
Number of queries more than 3550 out of 1775 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
291 ms |
856 KB |
Number of queries more than 3250 out of 1625 |
2 |
Halted |
0 ms |
0 KB |
- |