225252026-01-15 10:31:48BencuBizonyításcpp17Time limit exceeded 0/501.1s1844 KiB
#include <bits/stdc++.h>

using namespace std;
ifstream f("be.in");
int n,q;
bool a[501][501],L[501],b[501][501];
int hosz[501];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin>>n>>q;
    for (int v=1; v<=q; v++) {
        int x,z,y;
        cin>>z>>x>>y;
        if (z==1) {
            /*if (a[x][y]==0) {
                L[x]=1;
                a[x][y]=1;
                for (int i=1; i<=n; i++) {
                    if (a[y][i]==1 && L[y]==1) {a[x][i]=1; for (int j=1; j<=n; j++) if (a[j][x]==1) {a[j][i]=1; a[j][y]=1;}}
                    if (a[i][x]==1) {a[i][y]=1; /*for (int j=1; j<=n; j++) if (a[y][j]==1) a[i][j]=1;}
                }
            }*/
            a[x][y]=1;
            hosz[x]++;
            b[x][hosz[x]]=y;
            for (int t=1; t<=n; t++) {
                if (a[t][x]==1) {
                    if (a[t][y]==0) {
                    a[t][y]=1;
                    hosz[t]++;
                    b[t][hosz[t]]=y;
                    }
                    for (int j=1; j<=hosz[y]; j++) {
                        if ( a[t][b[y][j]]==0) {
                        a[t][b[y][j]]=1;
                        hosz[t]++;
                        b[t][hosz[t]]=j;
                        }
                    }    
                }
            }
        }
        else {
            if (a[x][y]==1) cout<<"IGEN"<<endl;
            else cout<<"NEM"<<endl;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Time limit exceeded1.083s1004 KiB
subtask20/10
3Wrong answer7ms508 KiB
4Accepted231ms564 KiB
5Time limit exceeded1.082s820 KiB
6Time limit exceeded1.082s804 KiB
7Time limit exceeded1.1s812 KiB
8Accepted2ms564 KiB
9Accepted4ms316 KiB
10Accepted307ms616 KiB
11Time limit exceeded1.09s564 KiB
12Time limit exceeded1.08s912 KiB
subtask30/15
13Accepted2ms316 KiB
14Wrong answer3ms508 KiB
15Wrong answer2ms316 KiB
16Wrong answer2ms316 KiB
17Accepted1ms316 KiB
18Wrong answer1ms316 KiB
19Wrong answer1ms396 KiB
20Accepted1ms316 KiB
21Wrong answer1ms560 KiB
22Wrong answer2ms508 KiB
23Wrong answer2ms316 KiB
24Accepted1ms316 KiB
25Wrong answer2ms316 KiB
26Wrong answer2ms316 KiB
27Wrong answer1ms316 KiB
28Wrong answer1ms316 KiB
29Wrong answer2ms316 KiB
30Accepted1ms316 KiB
31Wrong answer2ms316 KiB
32Wrong answer2ms508 KiB
33Wrong answer2ms500 KiB
34Wrong answer2ms316 KiB
35Wrong answer1ms316 KiB
36Wrong answer2ms508 KiB
37Wrong answer2ms508 KiB
38Wrong answer1ms316 KiB
subtask40/25
39Accepted2ms316 KiB
40Time limit exceeded1.1s932 KiB
41Wrong answer7ms508 KiB
42Accepted231ms564 KiB
43Time limit exceeded1.082s820 KiB
44Time limit exceeded1.082s804 KiB
45Time limit exceeded1.1s812 KiB
46Accepted2ms564 KiB
47Accepted4ms316 KiB
48Accepted307ms616 KiB
49Time limit exceeded1.09s564 KiB
50Time limit exceeded1.08s912 KiB
51Wrong answer3ms508 KiB
52Wrong answer2ms316 KiB
53Wrong answer2ms316 KiB
54Accepted1ms316 KiB
55Wrong answer1ms316 KiB
56Wrong answer1ms396 KiB
57Accepted1ms316 KiB
58Wrong answer1ms560 KiB
59Wrong answer2ms508 KiB
60Wrong answer2ms316 KiB
61Accepted1ms316 KiB
62Wrong answer2ms316 KiB
63Wrong answer2ms316 KiB
64Wrong answer1ms316 KiB
65Wrong answer1ms316 KiB
66Wrong answer2ms316 KiB
67Accepted1ms316 KiB
68Wrong answer2ms316 KiB
69Wrong answer2ms508 KiB
70Wrong answer2ms500 KiB
71Wrong answer2ms316 KiB
72Wrong answer1ms316 KiB
73Wrong answer2ms508 KiB
74Wrong answer2ms508 KiB
75Wrong answer1ms316 KiB
76Wrong answer137ms760 KiB
77Wrong answer722ms792 KiB
78Time limit exceeded1.098s856 KiB
79Wrong answer882ms792 KiB
80Time limit exceeded1.067s820 KiB
81Wrong answer266ms824 KiB
82Wrong answer832ms820 KiB
83Time limit exceeded1.087s724 KiB
84Time limit exceeded1.08s816 KiB
85Time limit exceeded1.08s820 KiB
86Wrong answer634ms1076 KiB
87Time limit exceeded1.092s824 KiB
88Time limit exceeded1.078s564 KiB
89Time limit exceeded1.077s780 KiB
90Accepted321ms1588 KiB
91Time limit exceeded1.09s820 KiB
92Accepted328ms1588 KiB
93Time limit exceeded1.078s820 KiB
94Accepted335ms1664 KiB
95Accepted820ms1076 KiB
96Time limit exceeded1.088s824 KiB
97Time limit exceeded1.083s820 KiB
98Accepted426ms1332 KiB
99Time limit exceeded1.082s860 KiB
100Wrong answer606ms1764 KiB
101Wrong answer638ms1588 KiB
102Wrong answer722ms1844 KiB
103Wrong answer722ms1844 KiB
104Wrong answer597ms1688 KiB