답안 #918157

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
918157 2024-01-29T13:20:00 Z rahidilbayramli Easter Eggs (info1cup17_eastereggs) C++17
0 / 100
2 ms 600 KB
#include<bits/stdc++.h>
#include "grader.h"
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()
#define pb push_back
#define f first
#define s second
using namespace std;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const ll sz = 550;
vector<int>g[sz];
vi order;
int vis[sz];
void dfs(int node)
{
    vis[node] = 1;
    order.pb(node);
    for(auto u : g[node])
    {
        if(!vis[u])
            dfs(u);
    }
}
int findEgg (int N, vector < pair < int, int > > bridges)
{
    for(auto u : bridges)
    {
        int x = u.f;
        int y = u.s;
        g[x].pb(y);
        g[y].pb(x);
    }
    dfs(1);
    int l = 0, r = order.size() - 1;
    while(l <= r)
    {
        int mid = (l + r) / 2;
        int ans = query(vi(order.begin(), order.begin()+mid));
        if(ans)
            r = mid - 1;
        else
            l = mid;
    }
    return order[l];
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 452 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 492 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -