Submission #1099425

#TimeUsernameProblemLanguageResultExecution timeMemory
1099425ChocoEaster Eggs (info1cup17_eastereggs)C++14
0 / 100
1 ms600 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...