제출 #283074

#제출 시각아이디문제언어결과실행 시간메모리
283074MKopchev장난감 기차 (IOI17_train)C++14
5 / 100
15 ms1920 KiB
#include "train.h" #include<bits/stdc++.h> using namespace std; const int nmax=1e6+42; set< pair<int,int> > edges; std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) { for(int i=0;i<u.size();i++) edges.insert({u[i],v[i]}); vector<int> win(a.size(),0); for(int i=a.size()-1;i>=0;i--) { if(edges.count({i,i})==0)win[i]=win[i+1]; else if(edges.count({i,i+1})==0)win[i]=r[i]; else { if(a[i]==1) { if(r[i]==1)win[i]=1; else win[i]=win[i+1]; } else { if(r[i]==0)win[i]=0; else win[i]=win[i+1]; } } } return win; }

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

train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:11:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for(int i=0;i<u.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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...