10020 | 2024-03-24 13:13:47 | 111 | Széfnyitás | cpp17 | Wrong answer 0/100 | 74ms | 5160 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),w(N+1),c;
int x=z;
for(int i=0;i<N;i++){
if(w[x]){
c.push_back(a[x]);
}
v[i]=a[x];
w[x]=1;
x=g[x][b[i]];
}
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 | 2024 KiB | ||||
subtask2 | 0/16 | ||||||
3 | Wrong answer | 2ms | 2228 KiB | ||||
4 | Wrong answer | 3ms | 2468 KiB | ||||
5 | Wrong answer | 3ms | 2848 KiB | ||||
6 | Wrong answer | 2ms | 2876 KiB | ||||
7 | Wrong answer | 2ms | 2728 KiB | ||||
8 | Wrong answer | 2ms | 2712 KiB | ||||
9 | Wrong answer | 2ms | 2716 KiB | ||||
10 | Wrong answer | 2ms | 2716 KiB | ||||
11 | Wrong answer | 2ms | 2724 KiB | ||||
12 | Wrong answer | 3ms | 2852 KiB | ||||
13 | Wrong answer | 2ms | 3080 KiB | ||||
subtask3 | 0/24 | ||||||
14 | Runtime error | 4ms | 3184 KiB | ||||
15 | Runtime error | 18ms | 3160 KiB | ||||
16 | Runtime error | 16ms | 3392 KiB | ||||
17 | Wrong answer | 3ms | 3468 KiB | ||||
18 | Runtime error | 4ms | 3396 KiB | ||||
19 | Runtime error | 9ms | 3612 KiB | ||||
20 | Runtime error | 14ms | 3704 KiB | ||||
21 | Runtime error | 8ms | 3708 KiB | ||||
subtask4 | 0/23 | ||||||
22 | Runtime error | 4ms | 3792 KiB | ||||
23 | Runtime error | 8ms | 3904 KiB | ||||
24 | Runtime error | 9ms | 3812 KiB | ||||
25 | Wrong answer | 6ms | 4048 KiB | ||||
26 | Runtime error | 9ms | 3952 KiB | ||||
27 | Wrong answer | 7ms | 4176 KiB | ||||
28 | Runtime error | 10ms | 4364 KiB | ||||
29 | Runtime error | 12ms | 4448 KiB | ||||
subtask5 | 0/37 | ||||||
30 | Wrong answer | 2ms | 2228 KiB | ||||
31 | Wrong answer | 3ms | 2468 KiB | ||||
32 | Wrong answer | 3ms | 2848 KiB | ||||
33 | Wrong answer | 2ms | 2876 KiB | ||||
34 | Wrong answer | 2ms | 2728 KiB | ||||
35 | Wrong answer | 2ms | 2712 KiB | ||||
36 | Wrong answer | 2ms | 2716 KiB | ||||
37 | Wrong answer | 2ms | 2716 KiB | ||||
38 | Wrong answer | 2ms | 2724 KiB | ||||
39 | Wrong answer | 3ms | 2852 KiB | ||||
40 | Wrong answer | 2ms | 3080 KiB | ||||
41 | Runtime error | 4ms | 3184 KiB | ||||
42 | Runtime error | 18ms | 3160 KiB | ||||
43 | Runtime error | 16ms | 3392 KiB | ||||
44 | Wrong answer | 3ms | 3468 KiB | ||||
45 | Runtime error | 4ms | 3396 KiB | ||||
46 | Runtime error | 9ms | 3612 KiB | ||||
47 | Runtime error | 14ms | 3704 KiB | ||||
48 | Runtime error | 8ms | 3708 KiB | ||||
49 | Runtime error | 4ms | 3792 KiB | ||||
50 | Runtime error | 8ms | 3904 KiB | ||||
51 | Runtime error | 9ms | 3812 KiB | ||||
52 | Wrong answer | 6ms | 4048 KiB | ||||
53 | Runtime error | 9ms | 3952 KiB | ||||
54 | Wrong answer | 7ms | 4176 KiB | ||||
55 | Runtime error | 10ms | 4364 KiB | ||||
56 | Runtime error | 12ms | 4448 KiB | ||||
57 | Runtime error | 8ms | 4336 KiB | ||||
58 | Runtime error | 74ms | 4408 KiB | ||||
59 | Runtime error | 25ms | 4636 KiB | ||||
60 | Runtime error | 9ms | 4656 KiB | ||||
61 | Runtime error | 43ms | 4996 KiB | ||||
62 | Runtime error | 65ms | 4928 KiB | ||||
63 | Runtime error | 57ms | 5028 KiB | ||||
64 | Runtime error | 35ms | 5000 KiB | ||||
65 | Runtime error | 43ms | 5140 KiB | ||||
66 | Runtime error | 54ms | 5148 KiB | ||||
67 | Runtime error | 52ms | 5160 KiB | ||||
68 | Runtime error | 48ms | 5088 KiB |