| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 702671 | onjo0127 | 드문 곤충 (IOI22_insects) | C++17 | 81 ms | 308 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
int in[2009];
int min_cardinality(int N) {
int c = 0, g = 0;
for(int i=0; i<N; i++) {
move_inside(i);
int x = press_button();
if(x == 2) move_outside(i);
else ++g, in[i] = 1;
}
c = g;
int l = 2, r = N/g, p = 1;
while(l <= r) {
int m = l+r >> 1;
if(r-l > 5) ++m;
if(m < p) for(int j=0; j<N; j++) if(in[j] > m) {
move_outside(j);
in[j] = 0;
--c;
}
for(int j=0; j<N; j++) if(!in[j]) {
move_inside(j);
int x = press_button();
if(x == m+1) move_outside(j);
else ++c, in[j] = m;
}
if(g*m != c) {
r = m-1;
for(int j=0; j<N; j++) if(!in[j]) in[j] = -1;
}
else l = m+1;
p = m;
}
return r;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
