QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#375588 | #5531. ICC | sichengzhou | 100 ✓ | 69ms | 4272kb | C++14 | 1.5kb | 2024-04-03 13:49:27 | 2024-04-03 13:49:27 |
Judging History
answer
#include "icc.h"
#include<bits/stdc++.h>
using namespace std;
const int N=105;
int n;
vector<int>c[N];
int a[N],b[N],lena,lenb,fa[N];
int getfa(int x)
{
if(x==fa[x])
{
return x;
}
return fa[x]=getfa(fa[x]);
}
void merge(int u,int v)
{
u=getfa(u);v=getfa(v);
fa[u]=v;
}
void run(int n)
{
for(int i=1;i<=n;i++)
{
fa[i]=i;
}
for(int t=1;t<n;t++)
{
for(int j=0;j<=6;j++)
{
lena=lenb=0;
for(int i=1;i<=n;i++)
{
if(getfa(i)>>j&1)
{
a[lena++]=i;
}else{
b[lenb++]=i;
}
}
if(lena==0||lenb==0)
{
continue;
}
if(query(lena,lenb,a,b))
{
int la,ra;
la=0,ra=lena;
while(la+1<ra)
{
int mid=(la+ra)/2;
if(query(ra-mid,lenb,a+mid,b))
{
la=mid;
}else{
ra=mid;
}
}
int lb,rb;
lb=0,rb=lenb;
while(lb+1<rb)
{
int mid=(lb+rb)/2;
if(query(1,rb-mid,a+la,b+mid))
{
lb=mid;
}else{
rb=mid;
}
}
setRoad(a[la],b[lb]);
merge(a[la],b[lb]);
break;
}
}
}
}
详细
Subtask #1:
score: 7
Accepted
Test #1:
score: 7
Accepted
time: 4ms
memory: 4060kb
input:
1 1500 3 15 0 2 0.0 2.5 0 3.5 0 1 1
output:
3 Ok! 102 queries used.
result:
points 1.0
Test #2:
score: 0
Accepted
time: 3ms
memory: 4068kb
input:
1 1500 4 15 0 0 0.0 3.5 0 2.5 5 1 1
output:
4 Ok! 98 queries used.
result:
points 1.0
Subtask #2:
score: 11
Accepted
Test #3:
score: 11
Accepted
time: 18ms
memory: 4180kb
input:
1 2500 4 50 0 0 0.0 3.5 0 2.5 5 1 1
output:
4 Ok! 540 queries used.
result:
points 1.0
Test #4:
score: 0
Accepted
time: 18ms
memory: 4200kb
input:
1 2500 4 50 0 1.3 0.0 0.7 0 3.5 15 2 1
output:
4 Ok! 647 queries used.
result:
points 1.0
Test #5:
score: 0
Accepted
time: 22ms
memory: 4188kb
input:
1 2500 3 50 0.05 2.3 0.1 0.7 0 1.5 1.7 2 1
output:
3 Ok! 635 queries used.
result:
points 1.0
Subtask #3:
score: 22
Accepted
Test #6:
score: 22
Accepted
time: 57ms
memory: 4124kb
input:
1 2250 6 100 0.05 2.3 0.1 0.7 0 1.5 1.7 1.1 1
output:
6 Ok! 1348 queries used.
result:
points 1.0
Test #7:
score: 0
Accepted
time: 68ms
memory: 4196kb
input:
1 2250 6 100 0.05 1.5 0.1 1.3 0.01 1.7 0 100 1
output:
6 Ok! 1597 queries used.
result:
points 1.0
Test #8:
score: 0
Accepted
time: 62ms
memory: 4108kb
input:
1 2250 5 100 0.00 2.00 0.00 1.70 0.10 1.30 5 1.15 1
output:
5 Ok! 1458 queries used.
result:
points 1.0
Test #9:
score: 0
Accepted
time: 57ms
memory: 4112kb
input:
1 2250 5 100 0.00 1.00 0.00 2.30 0.00 0.70 0 1.1 1
output:
5 Ok! 1351 queries used.
result:
points 1.0
Subtask #4:
score: 21
Accepted
Test #10:
score: 21
Accepted
time: 59ms
memory: 4128kb
input:
1 2000 5 100 0.01 1.00 0.10 1.70 0.00 1.50 5.0 1.20 1
output:
5 Ok! 1395 queries used.
result:
points 1.0
Test #11:
score: 0
Accepted
time: 66ms
memory: 4120kb
input:
1 2000 5 100 0.00 0.70 0.00 2.10 0.00 1.20 0.0 1.5 1
output:
5 Ok! 1553 queries used.
result:
points 1.0
Test #12:
score: 0
Accepted
time: 54ms
memory: 4196kb
input:
1 2000 6 100 0.01 0.70 0.00 2.70 0.00 1.90 3.5 1.1 1
output:
6 Ok! 1287 queries used.
result:
points 1.0
Test #13:
score: 0
Accepted
time: 60ms
memory: 4188kb
input:
1 2000 5 100 0.01 1.00 0.10 1.70 0.01 2.30 5.0 1.20 1
output:
5 Ok! 1414 queries used.
result:
points 1.0
Subtask #5:
score: 29
Accepted
Test #14:
score: 29
Accepted
time: 69ms
memory: 4128kb
input:
1 1775 4 100 0.00 0.00 0.00 2.70 0.10 7.55 0.0 1.15 1
output:
4 Ok! 1602 queries used.
result:
points 1.0
Test #15:
score: 0
Accepted
time: 69ms
memory: 4212kb
input:
1 1775 5 100 0.00 1.50 0.00 1.10 0.00 1.75 0.0 1.5 1
output:
5 Ok! 1589 queries used.
result:
points 1.0
Test #16:
score: 0
Accepted
time: 66ms
memory: 4128kb
input:
1 1775 5 100 0.01 1.50 0.00 1.10 0.01 1.75 0.0 1.3 1
output:
5 Ok! 1547 queries used.
result:
points 1.0
Test #17:
score: 0
Accepted
time: 68ms
memory: 4200kb
input:
1 1775 5 100 0.00 0.30 0.00 2.10 0.00 1.75 0.0 1.5 1
output:
5 Ok! 1583 queries used.
result:
points 1.0
Test #18:
score: 0
Accepted
time: 69ms
memory: 4060kb
input:
1 1775 5 100 0.01 0.70 0.00 2.70 0.00 1.90 3.5 1.5 1
output:
5 Ok! 1582 queries used.
result:
points 1.0
Test #19:
score: 0
Accepted
time: 57ms
memory: 4272kb
input:
1 1775 5 100 0.01 1.50 0.00 1.10 0.01 1.75 1.0 1.10 1
output:
5 Ok! 1424 queries used.
result:
points 1.0
Subtask #6:
score: 10
Accepted
Test #20:
score: 10
Accepted
time: 65ms
memory: 4220kb
input:
1 1625 5 100 0.00 0.00 0.00 3.00 0.00 1.00 0.0 3 1
output:
5 Ok! 1597 queries used.
result:
points 1.0
Test #21:
score: 0
Accepted
time: 68ms
memory: 4128kb
input:
1 1625 5 100 0.00 0.90 0.00 2.70 0.10 1.55 0.0 1.55 1
output:
5 Ok! 1565 queries used.
result:
points 1.0