제출 #624240

#제출 시각아이디문제언어결과실행 시간메모리
624240MatesV13Finding Routers (IOI20_routers)C++17
100 / 100
1 ms724 KiB
#include <bits/stdc++.h> using namespace std; int use_detector(int x); int rezultati[100005]; int nadi(int lo, int hi, int val){ if (lo==hi) return lo; int mid = (lo+hi+1)/2; if (!rezultati[mid]) rezultati[mid] = use_detector(mid) + 1; int odgovor = rezultati[mid]-1; if (odgovor >= val) return nadi(lo, mid-1, val); return nadi (mid, hi, val); } vector<int> find_routers(int l, int n, int q){ vector<int> poz; poz.push_back(0); while (poz.size() != n){ int temp = nadi(0, l, poz.size()); int idx = 2*temp-poz[poz.size()-1]; poz.push_back(idx); } return poz; }

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

routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:22:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   22 |  while (poz.size() != n){
      |         ~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...