제출 #138904

#제출 시각아이디문제언어결과실행 시간메모리
138904Hassoony늑대인간 (IOI18_werewolf)C++17
15 / 100
2738 ms19836 KiB
#include <bits/stdc++.h> #include "werewolf.h" //#include "grader.cpp" using namespace std; const int MX=3009; int vis[MX][4],n; vector<int>v[MX]; vector<int> check_validity(int N, vector<int> X, vector<int> Y, vector<int> S, vector<int> E, vector<int> L, vector<int> R){ n=N; for(int i=0;i<X.size();i++){ v[X[i]].push_back(Y[i]); v[Y[i]].push_back(X[i]); } vector<int>ans; for(int i=0;i<S.size();i++){ for(int j=0;j<n;j++){ for(int k=0;k<2;k++){ vis[j][k]=0; } } int s=S[i],e=E[i],l=L[i],r=R[i]; priority_queue<pair<int,int> >pq; pq.push({0,s}); while(!pq.empty()){ int x=pq.top().second,type=pq.top().first;pq.pop(); if(type == 0){ if(x < l)continue; } if(type == 1){ if(x > r)continue; } if(vis[x][type])continue; vis[x][type]=1; if(type == 1){ for(auto pp:v[x]) pq.push({type,pp}); } else{ for(auto pp:v[x]){ pq.push({type,pp}); } if(x >= l && x <= r){ pq.push({1,x}); } } } if(vis[e][1])ans.push_back(1); else ans.push_back(0); } return ans; }

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

werewolf.cpp: In function 'std::vector<int> check_validity(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
werewolf.cpp:13:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<X.size();i++){
                 ~^~~~~~~~~
werewolf.cpp:18:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<S.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...