# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
388880 |
2021-04-13T08:46:58 Z |
mariowong |
ICC (CEOI16_icc) |
C++14 |
|
318 ms |
492 KB |
#include <bits/stdc++.h>
#include "icc.h"
using namespace std;
int a[105],b[105],pt[10],ans1,ans2,nowl,nowr,nowmid,c[105],d[105];
void solve(int l,int r){
int mid=(l+r)/2;
if (l == r);
else
{
pt[0]=0; pt[1]=0;
for (int i=l;i<=mid;i++){
a[pt[0]]=i;
pt[0]++;
}
for (int i=mid+1;i<=r;i++){
b[pt[1]]=i;
pt[1]++;
}
if (query(pt[0],pt[1],a,b) == 0){
if (ans1 == 0 && ans2 == 0)
solve(l,mid);
if (ans1 == 0 && ans2 == 0)
solve(mid+1,r);
}
else
{
nowl=0; nowr=pt[0]-1;
while (nowl < nowr){
nowmid=(nowl+nowr)/2; pt[2]=0;
for (int i=nowl;i<=nowmid;i++){
c[pt[2]]=i;
pt[2]++;
}
if (query(pt[2],pt[1],c,b) == 0)
nowl=nowmid+1;
else
nowr=nowmid;
}
ans1=a[nowl];
nowl=0; nowr=pt[1]-1;
while (nowl < nowr){
nowmid=(nowl+nowr)/2; pt[3]=0;
for (int i=nowl;i<=nowmid;i++){
d[pt[3]]=i;
pt[3]++;
}
c[0]=ans1;
if (query(1,pt[3],c,d) == 0)
nowl=nowmid+1;
else
nowr=nowmid;
}
ans2=a[nowl];
}
}
}
void run(int N){
for (int i=1;i<N;i++){
ans1=0; ans2=0;
solve(1,N);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
460 KB |
Query cities not in range [1, n] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
460 KB |
Query cities not in range [1, n] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
492 KB |
Query cities not in range [1, n] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
318 ms |
476 KB |
Number of queries more than 4000 out of 2000 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
272 ms |
476 KB |
Number of queries more than 3550 out of 1775 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
492 KB |
Query cities not in range [1, n] |
2 |
Halted |
0 ms |
0 KB |
- |