Submission #1053210

#TimeUsernameProblemLanguageResultExecution timeMemory
1053210user736482Cop and Robber (BOI14_coprobber)C++17
16 / 100
34 ms1872 KiB
#include<bits/stdc++.h> #include<coprobber.h> using namespace std; vector<int> sasiad[507]; int akpos; int start(int n,bool a[][500]){ for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(a[i][j]){ sasiad[i].push_back(j); sasiad[j].push_back(i); } } } return 0; } int nextMove(int r){ bool odw[507]; int pop[507]; for(int i=0;i<507;i++) odw[i]=0; odw[akpos]=1; pop[akpos]=akpos; queue<int>q; q.push(akpos); while(!q.empty()){ int pom=q.front(); q.pop(); for(int i=0;i<sasiad[pom].size();i++){ if(!odw[sasiad[pom][i]]){ odw[sasiad[pom][i]]=1; pop[sasiad[pom][i]]=pom; q.push(sasiad[pom][i]); } } } while(pop[r]!=akpos) r=pop[r]; akpos=r; return r; }

Compilation message (stderr)

coprobber.cpp: In function 'int nextMove(int)':
coprobber.cpp:30:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |         for(int i=0;i<sasiad[pom].size();i++){
      |                     ~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...