# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
243047 | 2020-06-30T08:10:39 Z | soyeon_ss | Easter Eggs (info1cup17_eastereggs) | C++14 | 25 ms | 688 KB |
#include <bits/stdc++.h> #include "grader.h" //#define int long long #define pb push_back #define mp make_pair #define eb emplace_back #define fi first #define se second #define for1(i, a, b) for(i = a; i <= b; ++i) #define for0(i, a, b) for(i = a; i < b; ++i) #define forw1(i, a, b) for(i = a; i >= b; --i) #define forw0(i, a, b) for(i = a - 1; i >= b; --i) #define fora(v, a) for(auto v : a) #define bp __builtin_popcount #define bpll __builtin_popcountll using namespace std; using cd = complex<double>; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<cd> vcd; typedef vector<ii> vii; typedef vector<vector<int> > vvi; const int modd1 = 1e9 + 7, modd2 = 998244353, maxn = 520, K = 26, inf = 1e9, infll = 1e18; const double pi = acos(-1); int n, m, used[maxn]; vi gr[maxn], tp; int dfs(int st){ used[st] = 1; tp.pb(st); int i, j, k, l, r; for0(i, 0, (int)gr[st].size()){ if(!used[gr[st][i]]){ dfs(gr[st][i]); } } } int binsearch(int lo, int hi){ if(lo == hi){ return lo; } int mid = (lo + hi) >> 1; int i; vi kk; for1(i, 0, mid){ kk.pb(tp[i]); } if(query(kk)){ return binsearch(lo, mid); } else{ return binsearch(mid + 1, hi); } } int findEgg(int N, vii bridges){ int i; for0(i, 1, N){ gr[bridges[i - 1].fi].pb(bridges[i - 1].se); gr[bridges[i - 1].se].pb(bridges[i - 1].fi); } dfs(1); return tp[binsearch(0, N - 1)]; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 384 KB | Number of queries: 4 |
2 | Correct | 5 ms | 384 KB | Number of queries: 4 |
3 | Correct | 5 ms | 384 KB | Number of queries: 4 |
4 | Correct | 5 ms | 384 KB | Number of queries: 4 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 384 KB | Number of queries: 8 |
2 | Correct | 21 ms | 512 KB | Number of queries: 9 |
3 | Correct | 21 ms | 632 KB | Number of queries: 9 |
4 | Correct | 21 ms | 632 KB | Number of queries: 9 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 25 ms | 688 KB | Number of queries: 9 |
2 | Correct | 23 ms | 624 KB | Number of queries: 9 |
3 | Correct | 24 ms | 632 KB | Number of queries: 9 |
4 | Correct | 23 ms | 636 KB | Number of queries: 9 |