100202024-03-24 13:13:47111Széfnyitáscpp17Wrong answer 0/10074ms5160 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1828 KiB
2Wrong answer3ms2024 KiB
subtask20/16
3Wrong answer2ms2228 KiB
4Wrong answer3ms2468 KiB
5Wrong answer3ms2848 KiB
6Wrong answer2ms2876 KiB
7Wrong answer2ms2728 KiB
8Wrong answer2ms2712 KiB
9Wrong answer2ms2716 KiB
10Wrong answer2ms2716 KiB
11Wrong answer2ms2724 KiB
12Wrong answer3ms2852 KiB
13Wrong answer2ms3080 KiB
subtask30/24
14Runtime error4ms3184 KiB
15Runtime error18ms3160 KiB
16Runtime error16ms3392 KiB
17Wrong answer3ms3468 KiB
18Runtime error4ms3396 KiB
19Runtime error9ms3612 KiB
20Runtime error14ms3704 KiB
21Runtime error8ms3708 KiB
subtask40/23
22Runtime error4ms3792 KiB
23Runtime error8ms3904 KiB
24Runtime error9ms3812 KiB
25Wrong answer6ms4048 KiB
26Runtime error9ms3952 KiB
27Wrong answer7ms4176 KiB
28Runtime error10ms4364 KiB
29Runtime error12ms4448 KiB
subtask50/37
30Wrong answer2ms2228 KiB
31Wrong answer3ms2468 KiB
32Wrong answer3ms2848 KiB
33Wrong answer2ms2876 KiB
34Wrong answer2ms2728 KiB
35Wrong answer2ms2712 KiB
36Wrong answer2ms2716 KiB
37Wrong answer2ms2716 KiB
38Wrong answer2ms2724 KiB
39Wrong answer3ms2852 KiB
40Wrong answer2ms3080 KiB
41Runtime error4ms3184 KiB
42Runtime error18ms3160 KiB
43Runtime error16ms3392 KiB
44Wrong answer3ms3468 KiB
45Runtime error4ms3396 KiB
46Runtime error9ms3612 KiB
47Runtime error14ms3704 KiB
48Runtime error8ms3708 KiB
49Runtime error4ms3792 KiB
50Runtime error8ms3904 KiB
51Runtime error9ms3812 KiB
52Wrong answer6ms4048 KiB
53Runtime error9ms3952 KiB
54Wrong answer7ms4176 KiB
55Runtime error10ms4364 KiB
56Runtime error12ms4448 KiB
57Runtime error8ms4336 KiB
58Runtime error74ms4408 KiB
59Runtime error25ms4636 KiB
60Runtime error9ms4656 KiB
61Runtime error43ms4996 KiB
62Runtime error65ms4928 KiB
63Runtime error57ms5028 KiB
64Runtime error35ms5000 KiB
65Runtime error43ms5140 KiB
66Runtime error54ms5148 KiB
67Runtime error52ms5160 KiB
68Runtime error48ms5088 KiB