239982026-02-03 10:31:33KissCsongor777Bizonyításcpp17Time limit exceeded 0/501.118s262144 KiB
#include <iostream>
#include <vector>
#include <bits/stdc++.h>

using namespace std;


int n;

string dem(int x,int y,vector<vector<int> >&v)
{
    for(int i=0; i<=n-1; i++)
    {
        if(v[y-1][i]==1)
        {
        if(x==i+1)return "IGEN";
        return dem (x,i+1,v);
        }
    }

    return "NEM";
}

int main()
{
    int q,t,x,y;
    cin>>n>>q;

    vector<vector<int> > v(n, vector<int>(n,0));

    vector<string> r;

    for(int i=1; i<=q; i++)
    {
        cin>>t>>x>>y;

        if(t==1)v[y-1][x-1]=1;



       else r.push_back(dem(x,y,v));
    }

    vector<string>::iterator it;
    for(it=r.begin(); it!=r.end(); it++)cout<<*it<<endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Time limit exceeded1.093s95312 KiB
subtask20/10
3Runtime error809ms262144 KiB
4Time limit exceeded1.095s160812 KiB
5Time limit exceeded1.088s77364 KiB
6Time limit exceeded1.09s112948 KiB
7Time limit exceeded1.085s149808 KiB
8Wrong answer3ms564 KiB
9Runtime error615ms262144 KiB
10Time limit exceeded1.11s176948 KiB
11Time limit exceeded1.108s150068 KiB
12Time limit exceeded1.088s90668 KiB
subtask30/15
13Accepted2ms316 KiB
14Runtime error437ms262144 KiB
15Runtime error344ms262144 KiB
16Runtime error456ms262144 KiB
17Wrong answer1ms316 KiB
18Runtime error643ms262144 KiB
19Runtime error497ms262144 KiB
20Wrong answer1ms572 KiB
21Runtime error335ms262144 KiB
22Runtime error547ms262144 KiB
23Runtime error449ms262144 KiB
24Accepted1ms316 KiB
25Runtime error470ms262144 KiB
26Runtime error564ms262144 KiB
27Runtime error382ms262144 KiB
28Runtime error391ms262144 KiB
29Runtime error338ms262144 KiB
30Accepted2ms508 KiB
31Runtime error384ms262144 KiB
32Runtime error307ms262144 KiB
33Runtime error344ms262144 KiB
34Runtime error314ms262144 KiB
35Wrong answer1ms316 KiB
36Runtime error456ms262144 KiB
37Runtime error351ms262144 KiB
38Runtime error435ms262144 KiB
subtask40/25
39Accepted2ms316 KiB
40Time limit exceeded1.088s94660 KiB
41Runtime error809ms262144 KiB
42Time limit exceeded1.095s160812 KiB
43Time limit exceeded1.088s77364 KiB
44Time limit exceeded1.09s112948 KiB
45Time limit exceeded1.085s149808 KiB
46Wrong answer3ms564 KiB
47Runtime error615ms262144 KiB
48Time limit exceeded1.11s176948 KiB
49Time limit exceeded1.108s150068 KiB
50Time limit exceeded1.088s90668 KiB
51Runtime error437ms262144 KiB
52Runtime error344ms262144 KiB
53Runtime error456ms262144 KiB
54Wrong answer1ms316 KiB
55Runtime error643ms262144 KiB
56Runtime error497ms262144 KiB
57Wrong answer1ms572 KiB
58Runtime error335ms262144 KiB
59Runtime error547ms262144 KiB
60Runtime error449ms262144 KiB
61Accepted1ms316 KiB
62Runtime error470ms262144 KiB
63Runtime error564ms262144 KiB
64Runtime error382ms262144 KiB
65Runtime error391ms262144 KiB
66Runtime error338ms262144 KiB
67Accepted2ms508 KiB
68Runtime error384ms262144 KiB
69Runtime error307ms262144 KiB
70Runtime error344ms262144 KiB
71Runtime error314ms262144 KiB
72Wrong answer1ms316 KiB
73Runtime error456ms262144 KiB
74Runtime error351ms262144 KiB
75Runtime error435ms262144 KiB
76Time limit exceeded1.062s262144 KiB
77Time limit exceeded1.093s173228 KiB
78Time limit exceeded1.088s100144 KiB
79Time limit exceeded1.087s136012 KiB
80Time limit exceeded1.108s133548 KiB
81Time limit exceeded1.113s245336 KiB
82Time limit exceeded1.118s247584 KiB
83Time limit exceeded1.092s176692 KiB
84Time limit exceeded1.113s233876 KiB
85Time limit exceeded1.11s156468 KiB
86Time limit exceeded1.118s243952 KiB
87Time limit exceeded1.088s97340 KiB
88Time limit exceeded1.108s128852 KiB
89Time limit exceeded1.113s232244 KiB
90Wrong answer513ms9372 KiB
91Runtime error372ms262144 KiB
92Wrong answer547ms9372 KiB
93Runtime error395ms262144 KiB
94Wrong answer541ms9376 KiB
95Runtime error331ms262144 KiB
96Runtime error386ms262144 KiB
97Runtime error426ms262144 KiB
98Runtime error365ms262144 KiB
99Runtime error377ms262144 KiB
100Wrong answer620ms9404 KiB
101Wrong answer615ms9572 KiB
102Wrong answer704ms9868 KiB
103Wrong answer661ms9868 KiB
104Wrong answer532ms9368 KiB