# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
58560 |
2018-07-18T07:55:26 Z |
Mamnoon_Siam |
ICC (CEOI16_icc) |
C++17 |
|
377 ms |
796 KB |
#include "icc.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int n;
int ok[maxn][maxn];
int ask(int u, int v) {
int a[1] = {u}, b[1] = {v};
return query(1, 1, a, b);
}
int chex(int u) {
int a[1] = {u}, b[maxn];
int sz_a = 1, sz_b = 0;
for(int i = 1; i <= n; i++) {
if(i == u) continue;
if(!ok[u][i]) {
b[sz_b++] = i;
}
}
if(!sz_b) return 0;
return query(sz_a, sz_b, a, b);
}
int find_another(int u) {
int a[1] = {u}, b[1];
for(int i = 1; i <= n; i++) {
if(i == u) continue;
if(!ok[u][i]) {
b[0] = i;
if(query(1, 1, a, b)) {
return i;
}
}
} assert(false);
}
void run(int N) {
n = N;
while(true) {
// int u = -1;
// for(int i = 1; i <= n; i++) {
// if(chex(i)) {
// u = i;
// break;
// }
// }
// int v = find_another(u);
// if(u > v) swap(u, v);
for(int u = 1; u <= n; u++) {
for(int v = u + 1; v <= n; v++) {
if(!ok[u][v]) {
if(ask(u, v)) {
setRoad(u, v);
ok[u][v] = 1;
ok[v][u] = 1;
goto hell;
}
}
}
}
assert(false);
hell : ;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
63 ms |
632 KB |
Ok! 1015 queries used. |
2 |
Correct |
62 ms |
632 KB |
Ok! 1010 queries used. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
339 ms |
796 KB |
Number of queries more than 5000 out of 2500 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
377 ms |
796 KB |
Number of queries more than 4500 out of 2250 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
351 ms |
796 KB |
Number of queries more than 4000 out of 2000 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
345 ms |
796 KB |
Number of queries more than 3550 out of 1775 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
292 ms |
796 KB |
Number of queries more than 3250 out of 1625 |
2 |
Halted |
0 ms |
0 KB |
- |