# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
692402 | 2023-02-01T12:04:43 Z | MateiKing80 | Easter Eggs (info1cup17_eastereggs) | C++14 | 1 ms | 592 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; vector<int>ord; vector<int> v[600]; void dfs(int nod, int tata) { ord.push_back(nod); for(int i=0;i<v[nod].size();i++) { if(v[nod][i]!=tata) dfs(v[nod][i],nod); } } int sus(int st, int dr) { vector<int>vct; for(int i=st;i<=dr;i++) vct.push_back(ord[i]); int x=query( vct ); return x; } int findEgg(int n, vector<pair<int, int> > bridge) { for(int i=0;i<n-1;i++) { v[bridge[i].first].push_back(bridge[i].second); v[bridge[i].second].push_back(bridge[i].first); } dfs(1,0); int poz=0, pas= (1<<(int)log2(n)) ; while(pas>0) { if(!sus(poz,poz+pas)) poz=poz+pas+1; pas/=2; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 464 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 464 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 592 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |