제출 #139488

#제출 시각아이디문제언어결과실행 시간메모리
139488arthurconmy장난감 기차 (IOI17_train)C++14
0 / 100
2074 ms892 KiB
#include <bits/stdc++.h> #ifndef ARTHUR_LOCAL #include "train.h" #endif using namespace std; const int MAXN = 5000; bool is_loop[MAXN]; bool go_next[MAXN]; vector<int> who_wins(vector<int> A, vector<int> R, vector<int> U, vector<int> V) { int n = A.size(); int m = V.size(); for(int i=0; i<m; i++) { if(U[i]==V[i]) is_loop[U[i]]=1; else go_next[min(U[i],V[i])]=1; } vector<int> ans; for(int i=0; i<n; i++) { int cur=i; while(true) { if(is_loop[cur] && A[cur] && R[cur]) ans.push_back(1); if(is_loop[cur] && !A[cur] && !R[cur]) ans.push_back(0); if(ans.size()==i+1) break; if(!go_next[cur]) ans.push_back(R[cur]); if(ans.size()==i+1) break; cur=go_next[cur]; } } return ans; } #ifdef ARTHUR_LOCAL int main() { cout << "ppop" << endl; } #endif

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

train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:35:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(ans.size()==i+1) break;
       ~~~~~~~~~~^~~~~
train.cpp:39:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(ans.size()==i+1) break;
       ~~~~~~~~~~^~~~~
#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...