100222024-03-24 14:23:46111Széfnyitáscpp17Wrong answer 0/100187ms4528 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*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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1832 KiB
2Wrong answer3ms2052 KiB
subtask20/16
3Wrong answer3ms2232 KiB
4Wrong answer3ms2460 KiB
5Wrong answer3ms2600 KiB
6Wrong answer2ms2652 KiB
7Wrong answer3ms2780 KiB
8Wrong answer3ms2884 KiB
9Wrong answer3ms2972 KiB
10Wrong answer2ms3052 KiB
11Wrong answer2ms3052 KiB
12Wrong answer3ms3176 KiB
13Wrong answer3ms3392 KiB
subtask30/24
14Runtime error8ms3480 KiB
15Wrong answer2ms3492 KiB
16Wrong answer3ms3568 KiB
17Wrong answer2ms3484 KiB
18Wrong answer2ms3492 KiB
19Wrong answer3ms3608 KiB
20Wrong answer3ms3692 KiB
21Wrong answer3ms3700 KiB
subtask40/23
22Runtime error10ms3688 KiB
23Runtime error17ms3948 KiB
24Wrong answer3ms3932 KiB
25Wrong answer3ms3880 KiB
26Wrong answer2ms3972 KiB
27Wrong answer2ms3880 KiB
28Wrong answer3ms3900 KiB
29Wrong answer3ms4112 KiB
subtask50/37
30Wrong answer3ms2232 KiB
31Wrong answer3ms2460 KiB
32Wrong answer3ms2600 KiB
33Wrong answer2ms2652 KiB
34Wrong answer3ms2780 KiB
35Wrong answer3ms2884 KiB
36Wrong answer3ms2972 KiB
37Wrong answer2ms3052 KiB
38Wrong answer2ms3052 KiB
39Wrong answer3ms3176 KiB
40Wrong answer3ms3392 KiB
41Runtime error8ms3480 KiB
42Wrong answer2ms3492 KiB
43Wrong answer3ms3568 KiB
44Wrong answer2ms3484 KiB
45Wrong answer2ms3492 KiB
46Wrong answer3ms3608 KiB
47Wrong answer3ms3692 KiB
48Wrong answer3ms3700 KiB
49Runtime error10ms3688 KiB
50Runtime error17ms3948 KiB
51Wrong answer3ms3932 KiB
52Wrong answer3ms3880 KiB
53Wrong answer2ms3972 KiB
54Wrong answer2ms3880 KiB
55Wrong answer3ms3900 KiB
56Wrong answer3ms4112 KiB
57Runtime error28ms4248 KiB
58Runtime error187ms4292 KiB
59Runtime error112ms4156 KiB
60Runtime error156ms4152 KiB
61Wrong answer3ms4528 KiB
62Wrong answer3ms4388 KiB
63Wrong answer3ms4324 KiB
64Wrong answer3ms4384 KiB
65Wrong answer3ms4364 KiB
66Wrong answer3ms4376 KiB
67Wrong answer3ms4400 KiB
68Wrong answer3ms4436 KiB