Submission #46270

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
462702018-04-18 13:19:18hiddenteslaEaster Eggs (info1cup17_eastereggs)C++14
100 / 100
67 ms936 KiB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
vector<vector<int>> adj;
int findEgg (int n, vector < pair < int, int > > bridges)
{
adj.resize(n+1);
int temp,temp2;
for(temp=0;temp<bridges.size();temp++)
{
int x=bridges[temp].first,y=bridges[temp].second;
adj[x].push_back(y);
adj[y].push_back(x);
}
bool cntbisa[n+1]; int sisacnt=n;
memset(cntbisa,true,sizeof(cntbisa));
while(sisacnt>1)
{
//cout<<sisacnt<<"\n";
queue<int> q;
bool visited[n+1]; memset(visited,false,sizeof(visited));
q.push(1);
vector<int> stk;
int udh=0;
while(!q.empty())
{
int pos=q.front();
q.pop();
if(visited[pos]) continue;
visited[pos]=true;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:9:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(temp=0;temp<bridges.size();temp++)
                ~~~~^~~~~~~~~~~~~~~
eastereggs.cpp:37:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(temp=0;temp<adj[pos].size();temp++)
               ~~~~^~~~~~~~~~~~~~~~
eastereggs.cpp:51:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(temp=0;temp<stk.size();temp++) if(cntbisa[stk[temp]]) yangval.push_back(stk[temp]);
               ~~~~^~~~~~~~~~~
eastereggs.cpp:54:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(temp=0;temp<stk.size();temp++) cntbisa[stk[temp]]=true;
               ~~~~^~~~~~~~~~~
eastereggs.cpp:59:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(temp=0;temp<stk.size();temp++) cntbisa[stk[temp]]=false;
               ~~~~^~~~~~~~~~~
eastereggs.cpp:8:14: warning: unused variable 'temp2' [-Wunused-variable]
     int temp,temp2;
              ^~~~~
eastereggs.cpp:64:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...