제출 #33690

#제출 시각아이디문제언어결과실행 시간메모리
33690mohammad_kilani장난감 기차 (IOI17_train)C++14
0 / 100
1519 ms5996 KiB
#include <bits/stdc++.h> #include "train.h" using namespace std; const int N = 5010; bitset< N > win[N] ; vector<int> g[N]; std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) { vector<int> ans; int n = a.size(); for(int i=0;i<n;i++) win[i][0] = r[i]; for(int i=0;i<u.size();i++) g[u[i]].push_back(v[i]); for(int j=1;j<=n;j++){ for(int i=0;i<n;i++){ win[i][j] = a[i] ^ 1; for(int k=0;k<g[i].size();k++){ if(a[i]){ if(win[g[i][k]][j-1] || r[g[i][k]]) win[i][j] = 1; } else{ if(win[g[i][k]][j-1] == 0 && !r[g[i][k]]) win[i][j] = 0; } } } } for(int i=0;i<n;i++) ans.push_back(win[i][n]); return ans; }

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

train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:13:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<u.size();i++) g[u[i]].push_back(v[i]);
               ^
train.cpp:17:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int k=0;k<g[i].size();k++){
                 ^
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...