답안 #1109237

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1109237 2024-11-06T08:39:11 Z the_coding_pooh Easter Eggs (info1cup17_eastereggs) C++14
0 / 100
134 ms 131072 KB
#include <bits/stdc++.h>
#include "grader.h"

#define uwu return

using namespace std;

const int SIZE = 513;

vector <int> graph[SIZE];

#define fs first
#define sc second

void dfs(vector <int>& vertices, int nd, int rt){
    vertices.push_back(nd);
    for(auto i:graph[nd]){
        if(i != rt)
            dfs(vertices, i, nd);
    }
    return;
}

int findEgg (int N, vector <pair<int, int>> bridges){
    for(auto i:bridges){
        graph[i.fs].push_back(i.sc);
        graph[i.sc].push_back(i.fs);
    }
    vector <int> vertices;
    dfs(vertices, 1, 0);
    int L = 0, R = N - 1, M;
    while(L != R){
        vector <int> tmp = vertices;
        M = (L + R) / 2;
        tmp.erase(tmp.begin() + M, tmp.end());
        if(query(tmp))
            R = M;
        else
            L = M + 1;
    }
    return L;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 592 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 127 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 134 ms 131072 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -