# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
892748 | 2023-12-25T20:38:10 Z | Isam | Easter Eggs (info1cup17_eastereggs) | C++17 | 1 ms | 600 KB |
#include<bits/stdc++.h> #include "grader.h" #ifdef DEBUG #include "debug.h" #else #define debug(...) void(37) #endif using namespace std; constexpr int sz = 1001; #define pii pair<int, int> #define F first #define S second int timel; int tin[sz]; vector<vector<int>> g; inline void Dfs(int node, int fa = 1){ tin[++timel] = node; for(auto &to : g[node]){ if(to == fa) continue; Dfs(to, node); } return; } bool Query(int r){ vector<int> v; for(register int i(1); i <= r; ++i) v.emplace_back(tin[i]); return query(v); } int findEgg(int N, vector < pair < int, int > > bridges){ g.clear(), timel = 0; g.resize(N+1); for(register int i(0), a, b; i < N; ++i){ a = bridges[i].F, b = bridges[i].S; g[a].emplace_back(b), g[b].emplace_back(a); } Dfs(1); int l = 1, r = N, mid, best(0); while(l <= r){ mid = l + ((r - l) >> 1); if(Query(mid)){ best = mid; r = mid - 1; }else{ l = mid + 1; } } return tin[best]; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 340 KB | Number of queries: 5 |
2 | Partially correct | 1 ms | 344 KB | Number of queries: 5 |
3 | Partially correct | 1 ms | 344 KB | Number of queries: 5 |
4 | Partially correct | 1 ms | 344 KB | Number of queries: 5 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |