제출 #302074

#제출 시각아이디문제언어결과실행 시간메모리
302074TMJNSimurgh (IOI17_simurgh)C++17
13 / 100
71 ms512 KiB
#include "simurgh.h" #include <bits/stdc++.h> using namespace std; int N,T[10]; vector<int>U,V,res; bool B[30]; int par(int x){ if(T[x]==x)return x; return T[x]=par(T[x]); } void uni(int x,int y){ x=par(x); y=par(y); T[x]=y; } void dfs(int x,int t){ if(t==N-1){ for(int i=0;i<N;i++){ T[i]=i; } for(int i=0;i<U.size();i++){ if(B[i]){ uni(U[i],V[i]); } } bool f=true; for(int i=0;i<N-1;i++){ if(par(i)!=par(i+1))f=false; } if(f){ vector<int>v; for(int i=0;i<U.size();i++){ if(B[i]){ v.push_back(i); } } if(count_common_roads(v)==N-1){ res=v; } } } else{ for(int i=x;i<U.size();i++){ B[i]=true; dfs(i+1,t+1); B[i]=false; } } } vector<int>find_roads(int n,vector<int>u,vector<int>v){ N=n; U=u; V=v; dfs(0,0); return res; }

컴파일 시 표준 에러 (stderr) 메시지

simurgh.cpp: In function 'void dfs(int, int)':
simurgh.cpp:25:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   for(int i=0;i<U.size();i++){
      |               ~^~~~~~~~~
simurgh.cpp:36:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |    for(int i=0;i<U.size();i++){
      |                ~^~~~~~~~~
simurgh.cpp:47:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   47 |   for(int i=x;i<U.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...
#Verdict Execution timeMemoryGrader output
Fetching results...