QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#302715#370. CityNATURAL60 58ms14384kbC++14989b2024-01-11 09:48:392024-01-11 09:48:40

Judging History

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

  • [2024-01-11 09:48:40]
  • 评测
  • 测评结果:0
  • 用时:58ms
  • 内存:14384kb
  • [2024-01-11 09:48:39]
  • 提交

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

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 14384kb

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:

268435457 16777225 67108870 16777232 33554447 33554434 67108878 16777219 16777223 16777235 

input:

Interaction has been finished!

output:

2
2
2
2
2
2
2
2
2
1
1
0
1
0
0
1
2
0
1
1
1
1
0
1
2
2
1
2
2
2
2
2
2
2
2
2
1
1
1
2
2
2
0
0
0
268435457

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: 58ms
memory: 13792kb

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:

Unauthorized output

input:

Interaction has been finished!

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

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