# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
918503 | 2024-01-30T02:00:39 Z | hacizadal | Easter Eggs (info1cup17_eastereggs) | C++17 | 13 ms | 1664 KB |
#include <bits/stdc++.h> #include "grader.h" #define ll long long #define pll pair<ll, ll> using namespace std; vector<ll>g[550], eggs; ll used[550]; void dfs(ll v) { eggs.push_back(v); used[v] = 1; for (auto u : g[v]){ if (used[u] == 0){ dfs(u); } } } int findEgg (int N, vector < pair < int, int > > bridges) { for (ll i = 0; i<bridges.size(); i++){ g[bridges[i].first].push_back(bridges[i].second); g[bridges[i].second].push_back(bridges[i].first); } dfs(1); ll l = 0, r = N - 1; while (l < r){ ll m = (l + r)/2; vector<int>f; for (ll i = 0; i<m+1; i++){ f.push_back(eggs[i]); } if (query(f)){ r = m; } else { l = m + 1; } } return eggs[l]; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 456 KB | Number of queries: 4 |
2 | Correct | 1 ms | 452 KB | Number of queries: 4 |
3 | Correct | 1 ms | 460 KB | Number of queries: 4 |
4 | Correct | 0 ms | 460 KB | Number of queries: 4 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 988 KB | Number of queries: 8 |
2 | Correct | 8 ms | 1120 KB | Number of queries: 9 |
3 | Correct | 13 ms | 1532 KB | Number of queries: 9 |
4 | Correct | 11 ms | 1612 KB | Number of queries: 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 1312 KB | Number of queries: 9 |
2 | Correct | 10 ms | 1508 KB | Number of queries: 9 |
3 | Correct | 11 ms | 1664 KB | Number of queries: 9 |
4 | Correct | 12 ms | 1620 KB | Number of queries: 9 |