240002026-02-03 10:37:52KissCsongor777Bizonyításcpp17Time limit exceeded 0/501.115s262144 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()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    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.093s95804 KiB
subtask20/10
3Runtime error814ms262144 KiB
4Time limit exceeded1.09s156468 KiB
5Time limit exceeded1.083s78112 KiB
6Time limit exceeded1.087s112948 KiB
7Time limit exceeded1.098s152116 KiB
8Wrong answer3ms564 KiB
9Runtime error623ms262144 KiB
10Time limit exceeded1.093s179764 KiB
11Time limit exceeded1.11s148276 KiB
12Time limit exceeded1.088s90924 KiB
subtask30/15
13Accepted1ms316 KiB
14Runtime error435ms262144 KiB
15Runtime error354ms262144 KiB
16Runtime error451ms262144 KiB
17Wrong answer1ms316 KiB
18Runtime error708ms262144 KiB
19Runtime error495ms262144 KiB
20Wrong answer1ms508 KiB
21Runtime error375ms262144 KiB
22Runtime error495ms262144 KiB
23Runtime error458ms262144 KiB
24Accepted2ms500 KiB
25Runtime error467ms262144 KiB
26Runtime error507ms262144 KiB
27Runtime error379ms262144 KiB
28Runtime error384ms262144 KiB
29Runtime error360ms262144 KiB
30Accepted1ms316 KiB
31Runtime error340ms262144 KiB
32Runtime error337ms262144 KiB
33Runtime error342ms262144 KiB
34Runtime error303ms262144 KiB
35Wrong answer1ms508 KiB
36Runtime error451ms262144 KiB
37Runtime error344ms262144 KiB
38Runtime error421ms262144 KiB
subtask40/25
39Accepted1ms316 KiB
40Time limit exceeded1.083s93572 KiB
41Runtime error814ms262144 KiB
42Time limit exceeded1.09s156468 KiB
43Time limit exceeded1.083s78112 KiB
44Time limit exceeded1.087s112948 KiB
45Time limit exceeded1.098s152116 KiB
46Wrong answer3ms564 KiB
47Runtime error623ms262144 KiB
48Time limit exceeded1.093s179764 KiB
49Time limit exceeded1.11s148276 KiB
50Time limit exceeded1.088s90924 KiB
51Runtime error435ms262144 KiB
52Runtime error354ms262144 KiB
53Runtime error451ms262144 KiB
54Wrong answer1ms316 KiB
55Runtime error708ms262144 KiB
56Runtime error495ms262144 KiB
57Wrong answer1ms508 KiB
58Runtime error375ms262144 KiB
59Runtime error495ms262144 KiB
60Runtime error458ms262144 KiB
61Accepted2ms500 KiB
62Runtime error467ms262144 KiB
63Runtime error507ms262144 KiB
64Runtime error379ms262144 KiB
65Runtime error384ms262144 KiB
66Runtime error360ms262144 KiB
67Accepted1ms316 KiB
68Runtime error340ms262144 KiB
69Runtime error337ms262144 KiB
70Runtime error342ms262144 KiB
71Runtime error303ms262144 KiB
72Wrong answer1ms508 KiB
73Runtime error451ms262144 KiB
74Runtime error344ms262144 KiB
75Runtime error421ms262144 KiB
76Time limit exceeded1.014s262144 KiB
77Time limit exceeded1.088s177428 KiB
78Time limit exceeded1.083s98612 KiB
79Time limit exceeded1.09s138316 KiB
80Time limit exceeded1.09s131264 KiB
81Time limit exceeded1.095s234176 KiB
82Time limit exceeded1.115s249836 KiB
83Time limit exceeded1.095s183348 KiB
84Time limit exceeded1.093s234292 KiB
85Time limit exceeded1.093s151336 KiB
86Time limit exceeded1.113s246264 KiB
87Time limit exceeded1.088s99604 KiB
88Time limit exceeded1.083s127796 KiB
89Time limit exceeded1.092s224348 KiB
90Wrong answer405ms9624 KiB
91Runtime error368ms262144 KiB
92Wrong answer404ms9624 KiB
93Runtime error300ms262144 KiB
94Wrong answer405ms9628 KiB
95Runtime error303ms262144 KiB
96Runtime error345ms262144 KiB
97Runtime error347ms262144 KiB
98Runtime error351ms262144 KiB
99Runtime error342ms262144 KiB
100Wrong answer462ms9628 KiB
101Wrong answer501ms9624 KiB
102Wrong answer563ms9868 KiB
103Wrong answer528ms9868 KiB
104Wrong answer425ms9368 KiB