제출 #75019

#제출 시각아이디문제언어결과실행 시간메모리
75019RickMcCoy늑대인간 (IOI18_werewolf)C++14
15 / 100
440 ms21472 KiB
#include "werewolf.h" #include<bits/stdc++.h> using namespace std; vector<int> v[3000]; void dfs(int x, vector<bool> &y, int z, int w){for(auto i:v[x]) if(z<=i&&i<=w&&!y[i]) y[i] = 1, dfs(i, y, z, w);} 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(); vector<int> a(q); vector<bool> b(n), c(n); for(int i=0;i<x.size();i++) v[x[i]].push_back(y[i]), v[y[i]].push_back(x[i]); for(int i=0;i<q;i++) { fill(b.begin(), b.end(), 0), fill(c.begin(), c.end(), 0), b[s[i]] = c[e[i]] = 1, dfs(s[i], b, l[i], n-1), dfs(e[i], c, 0, r[i]); for(int j=0;j<n;j++) a[i]|=b[j]&c[j]; } return a; }

컴파일 시 표준 에러 (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:11:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<x.size();i++) v[x[i]].push_back(y[i]), v[y[i]].push_back(x[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...