Submission #1054703

#TimeUsernameProblemLanguageResultExecution timeMemory
1054703kiryl_krutskoSpring cleaning (CEOI20_cleaning)C++14
0 / 100
134 ms684 KiB
#include <iostream> #include <vector> using namespace std; struct node { int num; vector<int> conns; }; int main() { int n, q; cin >> n >> q; //vector<node> vec(n); int a, b; //vec[0].num = 0; for (int i = 1; i < n; i++) { //vec[i].num = i; cin >> a >> b; a--; b--; //vec[a].conns.push_back(b); //vec[b].conns.push_back(a); } int new_num; for (int i = 0; i < q; i++) { cin >> new_num; for (int j = 0; j < new_num; j++) { cin >> a; } if ((n - 1) % 2 == 1) { cout << "-1" << endl; } else cout << n - 1 + new_num << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...