답안 #959454

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
959454 2024-04-08T08:45:29 Z ramalzaher Easter Eggs (info1cup17_eastereggs) C++14
6 / 100
1 ms 456 KB
#include <bits/stdc++.h>
#include "grader.h"
#define pb push_back
#define FOR(i , n ) for(int i = 0 ; i < n ;i ++ )
using namespace std;
int findEgg (int N, vector < pair < int, int > > bridges)
{
    vector<int> V[N] ;
    map<int,bool> mp ;
    FOR(i ,N ) {
    auto [a , b ]  = bridges[i];
    if(query( { a , b } ) == 1 && (mp[a]==0 || mp[b]==0) ) {
        if(query( { a } ))return a ; else return b ;}
    mp[a] =1 ; mp[b] =1 ;
    }

    return N;
}

Compilation message

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:11:10: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   11 |     auto [a , b ]  = bridges[i];
      |          ^
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 344 KB Number of queries: 16
2 Partially correct 1 ms 340 KB Number of queries: 16
3 Partially correct 1 ms 344 KB Number of queries: 16
4 Partially correct 1 ms 344 KB Number of queries: 16
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 448 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 456 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -