10023 | 2024-03-24 14:24:51 | 111 | Széfnyitás | cpp17 | Wrong answer 0/100 | 64ms | 5216 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
int a[N+1],g[N+1][2];
for(int i=1;i<=N;i++){
cin>>a[i]>>g[i][0]>>g[i][1];
}
int K;
cin>>K;
for(int t=0;t<1000;t++){
vector<int>b(N);
for(int i=0;i<N;i++){
b[i]=rand()&1;
}
map<vector<int>,vector<int>>m;
int ok=1;
for(int z=1;z<=N;z++){
vector<int>v(N),c;
int x=z;
for(int i=0;i<N;i++){
v[i]=a[x];
x=g[x][b[x-1]];
}
vector<int>w(N+1);
for(int i=0;i<N*2;i++){
if(w[x]==1){
c.push_back(a[x]);
}
w[x]++;
x=g[x][a[x]];
}
if(m.count(v)&&m[v]!=c){
ok=0;
break;
}
m[v]=c;
}
if(ok){
return 0;
}
}
return 1;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1828 KiB | ||||
2 | Wrong answer | 3ms | 2096 KiB | ||||
subtask2 | 0/16 | ||||||
3 | Wrong answer | 2ms | 2072 KiB | ||||
4 | Wrong answer | 3ms | 2264 KiB | ||||
5 | Wrong answer | 3ms | 2472 KiB | ||||
6 | Wrong answer | 3ms | 2836 KiB | ||||
7 | Wrong answer | 3ms | 2860 KiB | ||||
8 | Wrong answer | 3ms | 3092 KiB | ||||
9 | Wrong answer | 3ms | 3112 KiB | ||||
10 | Wrong answer | 2ms | 3216 KiB | ||||
11 | Wrong answer | 2ms | 3180 KiB | ||||
12 | Wrong answer | 3ms | 3408 KiB | ||||
13 | Wrong answer | 3ms | 3544 KiB | ||||
subtask3 | 0/24 | ||||||
14 | Runtime error | 9ms | 3568 KiB | ||||
15 | Wrong answer | 3ms | 3680 KiB | ||||
16 | Wrong answer | 3ms | 3688 KiB | ||||
17 | Wrong answer | 3ms | 3684 KiB | ||||
18 | Wrong answer | 2ms | 3688 KiB | ||||
19 | Wrong answer | 3ms | 3688 KiB | ||||
20 | Wrong answer | 3ms | 3696 KiB | ||||
21 | Wrong answer | 2ms | 3700 KiB | ||||
subtask4 | 0/23 | ||||||
22 | Runtime error | 8ms | 3704 KiB | ||||
23 | Runtime error | 8ms | 3700 KiB | ||||
24 | Runtime error | 8ms | 3704 KiB | ||||
25 | Wrong answer | 3ms | 3936 KiB | ||||
26 | Wrong answer | 3ms | 4044 KiB | ||||
27 | Wrong answer | 3ms | 4276 KiB | ||||
28 | Wrong answer | 3ms | 4344 KiB | ||||
29 | Wrong answer | 3ms | 4328 KiB | ||||
subtask5 | 0/37 | ||||||
30 | Wrong answer | 2ms | 2072 KiB | ||||
31 | Wrong answer | 3ms | 2264 KiB | ||||
32 | Wrong answer | 3ms | 2472 KiB | ||||
33 | Wrong answer | 3ms | 2836 KiB | ||||
34 | Wrong answer | 3ms | 2860 KiB | ||||
35 | Wrong answer | 3ms | 3092 KiB | ||||
36 | Wrong answer | 3ms | 3112 KiB | ||||
37 | Wrong answer | 2ms | 3216 KiB | ||||
38 | Wrong answer | 2ms | 3180 KiB | ||||
39 | Wrong answer | 3ms | 3408 KiB | ||||
40 | Wrong answer | 3ms | 3544 KiB | ||||
41 | Runtime error | 9ms | 3568 KiB | ||||
42 | Wrong answer | 3ms | 3680 KiB | ||||
43 | Wrong answer | 3ms | 3688 KiB | ||||
44 | Wrong answer | 3ms | 3684 KiB | ||||
45 | Wrong answer | 2ms | 3688 KiB | ||||
46 | Wrong answer | 3ms | 3688 KiB | ||||
47 | Wrong answer | 3ms | 3696 KiB | ||||
48 | Wrong answer | 2ms | 3700 KiB | ||||
49 | Runtime error | 8ms | 3704 KiB | ||||
50 | Runtime error | 8ms | 3700 KiB | ||||
51 | Runtime error | 8ms | 3704 KiB | ||||
52 | Wrong answer | 3ms | 3936 KiB | ||||
53 | Wrong answer | 3ms | 4044 KiB | ||||
54 | Wrong answer | 3ms | 4276 KiB | ||||
55 | Wrong answer | 3ms | 4344 KiB | ||||
56 | Wrong answer | 3ms | 4328 KiB | ||||
57 | Runtime error | 30ms | 4460 KiB | ||||
58 | Runtime error | 64ms | 4560 KiB | ||||
59 | Runtime error | 28ms | 4564 KiB | ||||
60 | Runtime error | 29ms | 4644 KiB | ||||
61 | Wrong answer | 3ms | 4820 KiB | ||||
62 | Wrong answer | 4ms | 4808 KiB | ||||
63 | Wrong answer | 3ms | 5028 KiB | ||||
64 | Wrong answer | 3ms | 5120 KiB | ||||
65 | Wrong answer | 3ms | 5216 KiB | ||||
66 | Wrong answer | 3ms | 5116 KiB | ||||
67 | Wrong answer | 3ms | 5036 KiB | ||||
68 | Wrong answer | 3ms | 5068 KiB |