제출 #726324

#제출 시각아이디문제언어결과실행 시간메모리
726324ismayil드문 곤충 (IOI22_insects)C++17
10 / 100
385 ms296 KiB
#pragma GCC optimize("O3") #include "insects.h" #include <bits/stdc++.h> using namespace std; //g++ -std=c++17 insects.cpp stub.cpp int min_cardinality(int N) { vector<int> in; for(int j = 0; j < N; j++){ move_inside(j); if(press_button() > 1){ move_outside(j); }else{ in.push_back(j); } } int D = in.size(); while(!in.empty()) move_outside(in.back()), in.pop_back(); for(int i = 2; i <= N; i++){ vector<int> in; for(int j = 0; j < N; j++){ move_inside(j); if(press_button() > i){ move_outside(j); }else{ in.push_back(j); } } if(in.size() < i * D){ return i - 1; } while(!in.empty()) move_outside(in.back()), in.pop_back(); } return N; }

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:28:16: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   28 |   if(in.size() < i * D){
      |      ~~~~~~~~~~^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...