제출 #403204

#제출 시각아이디문제언어결과실행 시간메모리
403204iraira655Finding Routers (IOI20_routers)C++17
16 / 100
4 ms280 KiB
#include "routers.h" using namespace std; vector<int> find_routers(int l, int n, int q) { vector<int> ans; ans.push_back(0); int prev = 0, c = 0, prevPos = 0; for(int i=1; i<=l; i++){ int next = use_detector(i); c++; if(next!=prev){ prev = next; prevPos = 2*(c-1) ; ans.push_back(prevPos); c = 1; if(ans.size() == n) break; } } return ans; }

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

routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:17:21: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |       if(ans.size() == n) 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...