100232024-03-24 14:24:51111Széfnyitáscpp17Wrong answer 0/10064ms5216 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1828 KiB
2Wrong answer3ms2096 KiB
subtask20/16
3Wrong answer2ms2072 KiB
4Wrong answer3ms2264 KiB
5Wrong answer3ms2472 KiB
6Wrong answer3ms2836 KiB
7Wrong answer3ms2860 KiB
8Wrong answer3ms3092 KiB
9Wrong answer3ms3112 KiB
10Wrong answer2ms3216 KiB
11Wrong answer2ms3180 KiB
12Wrong answer3ms3408 KiB
13Wrong answer3ms3544 KiB
subtask30/24
14Runtime error9ms3568 KiB
15Wrong answer3ms3680 KiB
16Wrong answer3ms3688 KiB
17Wrong answer3ms3684 KiB
18Wrong answer2ms3688 KiB
19Wrong answer3ms3688 KiB
20Wrong answer3ms3696 KiB
21Wrong answer2ms3700 KiB
subtask40/23
22Runtime error8ms3704 KiB
23Runtime error8ms3700 KiB
24Runtime error8ms3704 KiB
25Wrong answer3ms3936 KiB
26Wrong answer3ms4044 KiB
27Wrong answer3ms4276 KiB
28Wrong answer3ms4344 KiB
29Wrong answer3ms4328 KiB
subtask50/37
30Wrong answer2ms2072 KiB
31Wrong answer3ms2264 KiB
32Wrong answer3ms2472 KiB
33Wrong answer3ms2836 KiB
34Wrong answer3ms2860 KiB
35Wrong answer3ms3092 KiB
36Wrong answer3ms3112 KiB
37Wrong answer2ms3216 KiB
38Wrong answer2ms3180 KiB
39Wrong answer3ms3408 KiB
40Wrong answer3ms3544 KiB
41Runtime error9ms3568 KiB
42Wrong answer3ms3680 KiB
43Wrong answer3ms3688 KiB
44Wrong answer3ms3684 KiB
45Wrong answer2ms3688 KiB
46Wrong answer3ms3688 KiB
47Wrong answer3ms3696 KiB
48Wrong answer2ms3700 KiB
49Runtime error8ms3704 KiB
50Runtime error8ms3700 KiB
51Runtime error8ms3704 KiB
52Wrong answer3ms3936 KiB
53Wrong answer3ms4044 KiB
54Wrong answer3ms4276 KiB
55Wrong answer3ms4344 KiB
56Wrong answer3ms4328 KiB
57Runtime error30ms4460 KiB
58Runtime error64ms4560 KiB
59Runtime error28ms4564 KiB
60Runtime error29ms4644 KiB
61Wrong answer3ms4820 KiB
62Wrong answer4ms4808 KiB
63Wrong answer3ms5028 KiB
64Wrong answer3ms5120 KiB
65Wrong answer3ms5216 KiB
66Wrong answer3ms5116 KiB
67Wrong answer3ms5036 KiB
68Wrong answer3ms5068 KiB