제출 #726309

#제출 시각아이디문제언어결과실행 시간메모리
726309ismayil드문 곤충 (IOI22_insects)C++17
0 / 100
1 ms208 KiB
#pragma GCC optimize("O3") #include "insects.h" #include <bits/stdc++.h> using namespace std; 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(); for(int i = 2; i <= N; i++){ 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); } } if(in.size() < i * D){ return i - 1; } } }

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

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