220212026-01-14 12:59:52BencuBizonyításcpp17Time limit exceeded 0/501.1s1344 KiB
#include <bits/stdc++.h>

using namespace std;
ifstream f("be.in");
int n,q;
bool a[501][501];
int main()
{
    cin>>n>>q;
    for (int v=1; v<=q; v++) {
        int x,z,y;
        cin>>z>>x>>y;
        if (z==1) {
            
            a[x][y]=1;
            for (int i=1; i<=n; i++) {
                if (a[y][i]==1) a[x][i]=1;
                for (int j=1; j<=n; j++) if (a[j][x]==1) a[j][i]=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;
            }
            
        }
        else {
            if (a[x][y]==1) cout<<"IGEN"<<endl;
            else cout<<"NEM"<<endl;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Time limit exceeded1.09s564 KiB
subtask20/10
3Wrong answer14ms500 KiB
4Wrong answer477ms316 KiB
5Time limit exceeded1.085s564 KiB
6Time limit exceeded1.085s748 KiB
7Time limit exceeded1.1s588 KiB
8Wrong answer52ms316 KiB
9Wrong answer8ms316 KiB
10Wrong answer592ms316 KiB
11Time limit exceeded1.082s316 KiB
12Time limit exceeded1.082s640 KiB
subtask30/15
13Accepted1ms316 KiB
14Wrong answer4ms316 KiB
15Wrong answer1ms316 KiB
16Wrong answer2ms552 KiB
17Accepted1ms316 KiB
18Wrong answer2ms316 KiB
19Wrong answer1ms316 KiB
20Accepted1ms316 KiB
21Wrong answer1ms316 KiB
22Wrong answer2ms316 KiB
23Wrong answer4ms316 KiB
24Accepted1ms316 KiB
25Wrong answer3ms316 KiB
26Wrong answer3ms316 KiB
27Wrong answer2ms316 KiB
28Wrong answer2ms500 KiB
29Wrong answer2ms316 KiB
30Accepted1ms316 KiB
31Wrong answer1ms316 KiB
32Wrong answer1ms316 KiB
33Wrong answer1ms508 KiB
34Wrong answer1ms316 KiB
35Accepted1ms408 KiB
36Wrong answer3ms316 KiB
37Wrong answer2ms316 KiB
38Wrong answer1ms316 KiB
subtask40/25
39Accepted1ms316 KiB
40Time limit exceeded1.1s648 KiB
41Wrong answer14ms500 KiB
42Wrong answer477ms316 KiB
43Time limit exceeded1.085s564 KiB
44Time limit exceeded1.085s748 KiB
45Time limit exceeded1.1s588 KiB
46Wrong answer52ms316 KiB
47Wrong answer8ms316 KiB
48Wrong answer592ms316 KiB
49Time limit exceeded1.082s316 KiB
50Time limit exceeded1.082s640 KiB
51Wrong answer4ms316 KiB
52Wrong answer1ms316 KiB
53Wrong answer2ms552 KiB
54Accepted1ms316 KiB
55Wrong answer2ms316 KiB
56Wrong answer1ms316 KiB
57Accepted1ms316 KiB
58Wrong answer1ms316 KiB
59Wrong answer2ms316 KiB
60Wrong answer4ms316 KiB
61Accepted1ms316 KiB
62Wrong answer3ms316 KiB
63Wrong answer3ms316 KiB
64Wrong answer2ms316 KiB
65Wrong answer2ms500 KiB
66Wrong answer2ms316 KiB
67Accepted1ms316 KiB
68Wrong answer1ms316 KiB
69Wrong answer1ms316 KiB
70Wrong answer1ms508 KiB
71Wrong answer1ms316 KiB
72Accepted1ms408 KiB
73Wrong answer3ms316 KiB
74Wrong answer2ms316 KiB
75Wrong answer1ms316 KiB
76Wrong answer177ms760 KiB
77Time limit exceeded1.1s596 KiB
78Time limit exceeded1.098s616 KiB
79Time limit exceeded1.08s564 KiB
80Time limit exceeded1.08s812 KiB
81Wrong answer402ms776 KiB
82Time limit exceeded1.082s564 KiB
83Time limit exceeded1.078s316 KiB
84Time limit exceeded1.087s576 KiB
85Time limit exceeded1.075s616 KiB
86Wrong answer986ms816 KiB
87Time limit exceeded1.09s564 KiB
88Time limit exceeded1.085s564 KiB
89Time limit exceeded1.082s564 KiB
90Accepted624ms1332 KiB
91Time limit exceeded1.08s568 KiB
92Accepted620ms1332 KiB
93Time limit exceeded1.082s564 KiB
94Accepted623ms1344 KiB
95Time limit exceeded1.075s564 KiB
96Time limit exceeded1.078s564 KiB
97Time limit exceeded1.088s500 KiB
98Time limit exceeded1.085s568 KiB
99Time limit exceeded1.085s564 KiB
100Time limit exceeded1.088s440 KiB
101Time limit exceeded1.09s316 KiB
102Time limit exceeded1.085s416 KiB
103Time limit exceeded1.082s508 KiB
104Time limit exceeded1.083s444 KiB