100212024-03-24 14:22:07111Széfnyitáscpp17Wrong answer 0/100166ms5056 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[i]];
			}
			vector<int>w(N+1);
			for(int i=0;i<N;i++){
				if(w[x]){
					c.push_back(a[x]);
				}
				w[x]=1;
				x=g[x][a[x]];
			}
			if(m.count(v)&&m[v]!=c){
				ok=0;
				break;
			}
			m[v]=c;
		}
		if(ok){
			return 0;
		}
	}
	return 1;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1864 KiB
2Wrong answer3ms2016 KiB
subtask20/16
3Wrong answer3ms2532 KiB
4Wrong answer3ms2536 KiB
5Wrong answer2ms2624 KiB
6Wrong answer3ms2808 KiB
7Wrong answer3ms2912 KiB
8Wrong answer2ms2924 KiB
9Wrong answer3ms3052 KiB
10Wrong answer3ms3280 KiB
11Wrong answer2ms3336 KiB
12Wrong answer2ms3332 KiB
13Wrong answer2ms3336 KiB
subtask30/24
14Runtime error8ms3404 KiB
15Wrong answer3ms3416 KiB
16Wrong answer3ms3540 KiB
17Wrong answer2ms3488 KiB
18Wrong answer3ms3492 KiB
19Wrong answer2ms3488 KiB
20Wrong answer3ms3492 KiB
21Wrong answer3ms3612 KiB
subtask40/23
22Runtime error8ms3692 KiB
23Runtime error14ms3696 KiB
24Wrong answer2ms3792 KiB
25Wrong answer3ms3700 KiB
26Wrong answer3ms3916 KiB
27Wrong answer3ms4004 KiB
28Wrong answer3ms4064 KiB
29Wrong answer3ms4016 KiB
subtask50/37
30Wrong answer3ms2532 KiB
31Wrong answer3ms2536 KiB
32Wrong answer2ms2624 KiB
33Wrong answer3ms2808 KiB
34Wrong answer3ms2912 KiB
35Wrong answer2ms2924 KiB
36Wrong answer3ms3052 KiB
37Wrong answer3ms3280 KiB
38Wrong answer2ms3336 KiB
39Wrong answer2ms3332 KiB
40Wrong answer2ms3336 KiB
41Runtime error8ms3404 KiB
42Wrong answer3ms3416 KiB
43Wrong answer3ms3540 KiB
44Wrong answer2ms3488 KiB
45Wrong answer3ms3492 KiB
46Wrong answer2ms3488 KiB
47Wrong answer3ms3492 KiB
48Wrong answer3ms3612 KiB
49Runtime error8ms3692 KiB
50Runtime error14ms3696 KiB
51Wrong answer2ms3792 KiB
52Wrong answer3ms3700 KiB
53Wrong answer3ms3916 KiB
54Wrong answer3ms4004 KiB
55Wrong answer3ms4064 KiB
56Wrong answer3ms4016 KiB
57Runtime error25ms3912 KiB
58Runtime error166ms4348 KiB
59Runtime error98ms4244 KiB
60Runtime error136ms4500 KiB
61Wrong answer3ms4732 KiB
62Wrong answer3ms4892 KiB
63Wrong answer3ms4916 KiB
64Wrong answer3ms4952 KiB
65Wrong answer3ms4888 KiB
66Wrong answer3ms5048 KiB
67Wrong answer3ms5056 KiB
68Wrong answer3ms4884 KiB