제출 #658595

#제출 시각아이디문제언어결과실행 시간메모리
658595pere_gil드문 곤충 (IOI22_insects)C++17
0 / 100
1 ms208 KiB
#include "insects.h" #include "bits/stdc++.h" using namespace std; void pri(queue<int> q){ printf(": "); while(!q.empty()){ printf("%d ",q.front()); q.pop(); } printf("\n"); } queue<int> get(queue<int> &q){ queue<int> in,out; while(!q.empty()){ int u=q.front(); q.pop(); move_inside(u); if(press_button()==1) in.push(u); else{ out.push(u); move_outside(u); } } while(!in.empty()){ move_outside(in.front()); in.pop(); } return out; } int min_cardinality(int n) { queue<int> q; for(int i=0;i<n;i++) q.push(i); q=get(q); int prev=q.size(); int res; for(res=1;res<n;res++){ q=get(q); if(prev!=q.size()) break; prev=q.size(); } return res; }

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:41:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::queue<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |   if(prev!=q.size()) break;
      |      ~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...