QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#375588#5531. ICCsichengzhou100 ✓70ms4308kbC++141.5kb2024-04-03 13:49:272024-07-01 04:28:44

Judging History

你现在查看的是最新测评结果

  • [2024-07-01 04:28:44]
  • 管理员手动重测本题所有提交记录
  • 测评结果:100
  • 用时:70ms
  • 内存:4308kb
  • [2024-04-03 13:49:27]
  • 评测
  • 测评结果:100
  • 用时:69ms
  • 内存:4272kb
  • [2024-04-03 13:49:27]
  • 提交

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;
        }
    }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 7
Accepted

Test #1:

score: 7
Accepted
time: 4ms
memory: 4092kb

input:

1
1500 3
15

0
2

0.0
2.5

0
3.5

0

1 1

output:

3
Ok! 102 queries used.

result:

ok 

Test #2:

score: 0
Accepted
time: 3ms
memory: 4140kb

input:

1
1500 4
15

0
0

0.0
3.5

0
2.5

5

1 1

output:

4
Ok! 98 queries used.

result:

ok 

Subtask #2:

score: 11
Accepted

Test #3:

score: 11
Accepted
time: 19ms
memory: 4308kb

input:

1
2500 4
50

0
0

0.0
3.5

0
2.5

5

1 1

output:

4
Ok! 540 queries used.

result:

ok 

Test #4:

score: 0
Accepted
time: 22ms
memory: 4092kb

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:

ok 

Test #5:

score: 0
Accepted
time: 19ms
memory: 4140kb

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:

ok 

Subtask #3:

score: 22
Accepted

Test #6:

score: 22
Accepted
time: 57ms
memory: 4100kb

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:

ok 

Test #7:

score: 0
Accepted
time: 65ms
memory: 4236kb

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:

ok 

Test #8:

score: 0
Accepted
time: 64ms
memory: 4148kb

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:

ok 

Test #9:

score: 0
Accepted
time: 56ms
memory: 4092kb

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:

ok 

Subtask #4:

score: 21
Accepted

Test #10:

score: 21
Accepted
time: 59ms
memory: 4232kb

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:

ok 

Test #11:

score: 0
Accepted
time: 67ms
memory: 4304kb

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:

ok 

Test #12:

score: 0
Accepted
time: 53ms
memory: 4096kb

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:

ok 

Test #13:

score: 0
Accepted
time: 61ms
memory: 4148kb

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:

ok 

Subtask #5:

score: 29
Accepted

Test #14:

score: 29
Accepted
time: 70ms
memory: 4100kb

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:

ok 

Test #15:

score: 0
Accepted
time: 68ms
memory: 4104kb

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:

ok 

Test #16:

score: 0
Accepted
time: 66ms
memory: 4160kb

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:

ok 

Test #17:

score: 0
Accepted
time: 69ms
memory: 4164kb

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:

ok 

Test #18:

score: 0
Accepted
time: 69ms
memory: 4148kb

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:

ok 

Test #19:

score: 0
Accepted
time: 61ms
memory: 4096kb

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:

ok 

Subtask #6:

score: 10
Accepted

Test #20:

score: 10
Accepted
time: 66ms
memory: 4096kb

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:

ok 

Test #21:

score: 0
Accepted
time: 67ms
memory: 4244kb

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:

ok