제출 #299661

#제출 시각아이디문제언어결과실행 시간메모리
299661TMJN늑대인간 (IOI18_werewolf)C++17
15 / 100
4042 ms21880 KiB
#include "werewolf.h" #include <bits/stdc++.h> using namespace std; vector<int>V[200000]; bool vis1[200000],vis2[200000]; vector<int>check_validity(int N,vector<int>X,vector<int>Y,vector<int>S,vector<int>E,vector<int>L,vector<int>R){ int Q=S.size(); for(int i=0;i<X.size();i++){ V[X[i]].push_back(Y[i]); V[Y[i]].push_back(X[i]); } vector<int>res(Q,0); for(int i=0;i<Q;i++){ for(int j=0;j<N;j++){ vis1[j]=vis2[j]=false; } queue<int>que; que.push(S[i]); while(!que.empty()){ int x=que.front(); que.pop(); if(vis1[x]||x<L[i])continue; vis1[x]=true; for(int j:V[x]){ que.push(j); } } que.push(E[i]); while(!que.empty()){ int x=que.front(); que.pop(); if(vis2[x]||x>R[i])continue; vis2[x]=true; for(int j:V[x]){ que.push(j); } } for(int j=0;j<N;j++){ if(vis1[j]&&vis2[j])res[i]=1; } } return res; }

컴파일 시 표준 에러 (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:10:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for(int i=0;i<X.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...