제출 #139156

#제출 시각아이디문제언어결과실행 시간메모리
139156rajarshi_basu늑대인간 (IOI18_werewolf)C++14
0 / 100
469 ms524288 KiB
#include <bits/stdc++.h> #include "werewolf.h" #define FOR(i,n) for(int i=0;i<n;i++) #define FORE(i,a,b) for(int i = a;i<=b;i++) #define ll long long int #define pb push_back #define vi vector<int> #define ff first #define ss second #define vv vector #define ii pair<int,int> using namespace std; const int MAXN = 3001; vi g[MAXN]; bool reachableHuman[MAXN]; bool reachableWolf[MAXN]; bool vis[MAXN]; void dfs(int node,int mode,int x){ if(vis[node])return; if(mode == 1)reachableHuman[node] = 1; if(mode == 2)reachableWolf[node] = 1; for(auto e : g[node]){ if(mode == 1 and e >= x)dfs(e,mode,x); if(mode == 2 and e <= x)dfs(e,mode,x); } } bool solve(int n,int l,int r,int s,int e){ FOR(i,n)reachableHuman[i] = reachableWolf[i] = vis[i] = 0; dfs(s,1,l); dfs(e,2,r); FOR(i,n)if(reachableHuman[i] and reachableWolf[i])return true; return false; } vi check_validity(int n,vi x,vi y,vi s,vi e,vi l,vi r){ FOR(i,x.size()){ g[x[i]].pb(y[i]); g[y[i]].pb(x[i]); } int q = s.size(); vi ret;FOR(i,n)ret.pb(0); FOR(i,q){ ret[i] = solve(n,l[i],r[i],s[i],e[i]); } return ret; } int ma1in(){ ios_base::sync_with_stdio(0); cin.tie(0); return 0; }

컴파일 시 표준 에러 (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:5:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define FOR(i,n) for(int i=0;i<n;i++)
werewolf.cpp:44:6:
  FOR(i,x.size()){
      ~~~~~~~~~~                
werewolf.cpp:44:2: note: in expansion of macro 'FOR'
  FOR(i,x.size()){
  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...