# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1042008 | 2024-08-02T12:05:37 Z | blackslex | Easter Eggs (info1cup17_eastereggs) | C++17 | 10 ms | 600 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; using pii = pair<int, int>; int findEgg (int N, vector<pair<int, int>> bridges) { int n = N; vector<vector<int>> v(n + 5); for (auto &[x, y]: bridges) v[x].emplace_back(y), v[y].emplace_back(x); vector<int> ord; queue<int> q; q.emplace(1); vector<bool> f(n + 5); while (!q.empty()) { int cur = q.front(); q.pop(); if (f[cur]) continue; f[cur] = 1; ord.emplace_back(cur); for (auto &e: v[cur]) q.emplace(e); } int l = 0, r = n - 1; while (l < r) { int mid = (l + r) >> 1; vector<int> ask(ord.begin(), ord.begin() + mid + 1); if (query(ask)) r = mid; else l = mid + 1; } return ord[l]; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Number of queries: 4 |
2 | Correct | 1 ms | 344 KB | Number of queries: 4 |
3 | Correct | 1 ms | 344 KB | Number of queries: 4 |
4 | Correct | 0 ms | 344 KB | Number of queries: 4 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 344 KB | Number of queries: 8 |
2 | Correct | 7 ms | 600 KB | Number of queries: 9 |
3 | Correct | 9 ms | 600 KB | Number of queries: 9 |
4 | Correct | 8 ms | 344 KB | Number of queries: 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 344 KB | Number of queries: 9 |
2 | Correct | 9 ms | 344 KB | Number of queries: 9 |
3 | Correct | 8 ms | 512 KB | Number of queries: 9 |
4 | Correct | 10 ms | 500 KB | Number of queries: 9 |