152672025-02-17 19:00:38TakacsAndrasTúra (75 pont)cpp17Wrong answer 23/7583ms3124 KiB
#include <bits/stdc++.h>
using namespace std;
int main() {
    int t; cin >> t;
    while (t--) {
        int n; cin >> n;
        vector<int> a(n+1);
        for (int i = 1; i <= n; i++) cin >> a[i];
        vector<vector<int>> g(n+1);
        bool f = false;
        int out1 = -1, out2 = -1;
        for (int i = 0; i < n-1; i++) {
            int x1,x2; cin >> x1 >> x2;
            if (a[x1] == -1 && a[x2] == -1) {
                out1 = x1;
                out2 = x2;
            }
        }
        if (out1 == -1) cout << "IGEN\n";
        else cout << "NEM\n2\n" << out1 << ' ' << out2 << '\n';
    }
}
SubtaskSumTestVerdictTimeMemory
base23/75
1Accepted0/01ms316 KiB
2Wrong answer0/01ms512 KiB
3Wrong answer0/61ms316 KiB
4Accepted3/37ms316 KiB
5Wrong answer0/37ms404 KiB
6Wrong answer0/47ms392 KiB
7Wrong answer0/47ms316 KiB
8Wrong answer0/47ms316 KiB
9Wrong answer0/271ms680 KiB
10Accepted2/272ms680 KiB
11Wrong answer0/271ms572 KiB
12Wrong answer0/271ms572 KiB
13Wrong answer0/271ms572 KiB
14Wrong answer0/372ms572 KiB
15Accepted2/271ms816 KiB
16Accepted2/271ms688 KiB
17Wrong answer0/271ms764 KiB
18Wrong answer0/271ms572 KiB
19Wrong answer0/371ms572 KiB
20Wrong answer0/274ms680 KiB
21Wrong answer0/272ms572 KiB
22Wrong answer0/374ms572 KiB
23Accepted2/282ms3124 KiB
24Accepted2/282ms3124 KiB
25Accepted2/281ms1740 KiB
26Accepted2/282ms1740 KiB
27Wrong answer0/282ms1636 KiB
28Wrong answer0/282ms1636 KiB
29Accepted2/283ms1776 KiB
30Wrong answer0/281ms1740 KiB
31Accepted2/282ms1680 KiB
32Accepted2/283ms1744 KiB