QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#302716#370. CityNATURAL60 66ms14436kbC++141009b2024-01-11 09:50:492024-01-11 09:50:50

Judging History

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

  • [2024-01-11 09:50:50]
  • 评测
  • 测评结果:0
  • 用时:66ms
  • 内存:14436kb
  • [2024-01-11 09:50:49]
  • 提交

Encoder

#include<bits/stdc++.h>
#include "Encoder.h"
using namespace std;
int n,siz[250010],dfn[250010],tot;
vector<int>e[250010];
inline void dfs(int rt,int da)
{
    siz[rt]=1;dfn[rt]=++tot;
    for(int i:e[rt])
    {
        if(i==da)continue;
        dfs(i,rt);siz[rt]+=siz[i];
    }
    int s=1<<(32-__builtin_clz(siz[rt]));
    tot+=s-siz[rt];siz[rt]=s;
    return ;
}
void Encode(int N,int A[],int B[])
{
    n=N;
    for(int i=0;i<n-1;++i)
    {
        e[A[i]].emplace_back(B[i]);
        e[B[i]].emplace_back(A[i]);
    }
    dfs(0,0);
    for(int i=0;i<n;++i)Code(i,dfn[i]|((31-__builtin_clz(siz[i]))<<23));
    return ;
}

Device

#include<bits/stdc++.h>
#include "Device.h"
using namespace std;
void InitDevice(){return ;}
int Answer(long long S,long long T)
{
    int Mx=(1<<24)-1,dfns,dfnt,sizs,sizt;
    dfns=S&Mx,dfnt=T&Mx;
    sizs=1<<(S>>23);sizt=1<<(T>>23);
    if(dfns<=dfnt&&dfnt<=dfns+sizs-1)return 1;
    if(dfnt<=dfns&&dfns<=dfnt+sizt-1)return 0;
    return 2;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 6ms
memory: 14436kb

input:

10 45
0 5
0 2
4 3
6 4
0 6
2 8
6 9
2 1
5 7
5 0
0 2
8 0
0 7
0 6
1 0
4 0
0 3
0 9
5 2
5 8
7 5
5 6
1 5
4 5
5 3
9 5
8 2
7 2
2 6
2 1
2 4
3 2
2 9
7 8
6 8
8 1
8 4
3 8
9 8
6 7
1 7
4 7
3 7
9 7
1 6
6 4
6 3
6 9
4 1
1 3
9 1
3 4
9 4
9 3

output:

41943041 8388617 25165830 8388624 16777231 16777218 25165838 8388611 8388615 8388627 

input:

Interaction has been finished!

output:

2
1
0
1
1
0
2
1
1
2
2
2
2
2
2
2
2
0
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
41943041

result:

wrong answer Wrong Answer [6] (Query #1 returned 2 but expected 0)

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 66ms
memory: 13560kb

input:

700 244650
407 643
680 336
573 208
466 455
159 648
575 549
50 567
251 211
211 481
530 513
136 334
112 492
175 396
643 483
265 132
20 160
174 550
251 90
99 236
579 374
670 613
495 379
251 170
652 61
495 467
27 317
202 484
420 592
542 354
565 650
35 88
216 681
277 219
299 171
220 647
418 433
434 660
2...

output:

125829121 16783946 8405004 8392718 16794696 25171903 16794799 8395590 8395206 8406275 25182482 8395350 8393872 16777294 8406097 16793626 8394454 16794647 8406040 8391244 33561008 58725893 8393775 8394703 8395178 8394971 8390861 25165873 8388620 8406228 16779866 8405262 25183291 8405129 16794638 6711...

input:

Interaction has been finished!

output:

0
2
2
2
2
2
1
2
1
1
0
0
1
0
1
1
2
2
2
1
1
1
0
1
2
0
2
2
2
2
2
2
2
2
2
1
2
1
2
2
1
0
0
0
2
1
1
0
0
1
2
0
2
2
0
2
2
1
1
0
0
2
2
2
1
2
2
0
2
1
2
2
2
1
0
1
1
2
0
1
1
2
2
2
2
0
1
2
0
2
2
0
2
1
0
1
0
2
1
0
0
2
2
2
2
1
2
1
2
2
1
1
1
1
1
2
1
2
2
0
1
0
0
2
0
2
0
2
2
1
2
0
2
0
1
2
1
1
1
2
2
0
2
0
2
0
2
2
0
1
...

result:

wrong answer Wrong Answer [6] (Query #2 returned 2 but expected 0)