Submission #1099425

# Submission time Handle Problem Language Result Execution time Memory
1099425 2024-10-11T09:42:08 Z Choco Easter Eggs (info1cup17_eastereggs) C++14
0 / 100
1 ms 600 KB
#include <bits/stdc++.h>
#include "grader.h"
#define ll long long
using namespace std;
vector<vector<ll>>v(513);
vector<ll>order;
vector<bool>check(513,0);
void dfs(ll i){
    check[i]=1;
    order.push_back(i);
    for(ll j=0;j<v[i].size();j++)
    if(!check[j])
    dfs(j);
}
int findEgg (int N, vector < pair < int, int > > bridges)
{
    for(ll i=0;i<=bridges.size();i++){
        ll x=bridges[i].first;
        ll y=bridges[i].second;
        v[i].push_back(y);
        v[y].push_back(x);
    }
    dfs(1);
    ll l=0,r=N-1;
    while(l!=r){
        ll mid=(l+r)/2;
        if(query(vector<int>(order.begin(),order.begin()+mid)))
        r=mid-1;
        else
        l=mid;
    }
}

Compilation message

eastereggs.cpp: In function 'void dfs(long long int)':
eastereggs.cpp:11:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(ll j=0;j<v[i].size();j++)
      |                ~^~~~~~~~~~~~
eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:17:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for(ll i=0;i<=bridges.size();i++){
      |                ~^~~~~~~~~~~~~~~~
eastereggs.cpp:32:1: warning: no return statement in function returning non-void [-Wreturn-type]
   32 | }
      | ^
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -