# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
484222 | 2021-11-02T14:29:39 Z | Alexandruabcde | Easter Eggs (info1cup17_eastereggs) | C++14 | 20 ms | 476 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; constexpr int NMAX = 1000; vector <int> G[NMAX]; vector <int> vec; void Parcurgere_Euler (int Node, int Dad = -1) { vec.push_back(Node); for (auto it : G[Node]) { if (it == Dad) continue; Parcurgere_Euler(it, Node); } } bool Check (int Right) { vector <int> ask; for (int i = 0; i <= Right; ++ i ) ask.push_back(vec[i]); return query(ask); } int findEgg (int N, vector < pair < int, int > > bridges) { vec.clear(); for (int i = 1; i <= N; ++ i ) G[i].clear(); for (int i = 0; i < bridges.size(); ++ i ) { int x = bridges[i].first; int y = bridges[i].second; G[x].push_back(y); G[y].push_back(x); } Parcurgere_Euler(1, -1); int st = 1, dr = vec.size()-1; int ans = 0; while (st <= dr) { int mij = (st + dr) / 2; if (Check(mij)) { dr = mij - 1; ans = mij; } else st = mij + 1; } return vec[ans]; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 344 KB | Number of queries: 8 |
2 | Correct | 11 ms | 352 KB | Number of queries: 9 |
3 | Correct | 16 ms | 352 KB | Number of queries: 9 |
4 | Correct | 20 ms | 352 KB | Number of queries: 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 368 KB | Number of queries: 9 |
2 | Correct | 18 ms | 340 KB | Number of queries: 9 |
3 | Runtime error | 7 ms | 476 KB | Execution killed with signal 6 |
4 | Halted | 0 ms | 0 KB | - |