# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1237312 | CyberCow | 드문 곤충 (IOI22_insects) | C++20 | 96 ms | 416 KiB |
#include "insects.h"
#include <vector>
#include <random>
#include <algorithm>
using namespace std;
mt19937 rnd(532);
//void move_inside(int i)
//
//void move_outside(int i)
//
//int press_button()
int min_cardinality(int N)
{
vector<int> v;
for (int i = 0; i < N; i++)
{
v.push_back(i);
}
//shuffle(v.begin(), v.end(), rnd);
for (int i = 0; i < v.size(); i++)
{
move_inside(i);
}
int skzb = press_button();
int taza;
int st = 1;
while (st)
{
for (int i = 0; i < v.size(); i++)
{
move_outside(v[i]);
int yntac = press_button();
if (yntac != skzb)
{
vector<int> vv;
vv.push_back(i);
move_inside(v[i]);
for (int j = i + 1; j < v.size(); j++)
{
move_outside(v[j]);
int qaqul = press_button();
if (qaqul != skzb)
{
vv.push_back(j);
}
move_inside(v[j]);
if (vv.size() == skzb)
break;
}
for (int j = 0; j < i; j++)
{
move_inside(v[j]);
}
for (int j = vv.size() - 1; j >= 0; j--)
{
move_outside(v[vv[j]]);
swap(v[vv[j]], v.back());
v.pop_back();
}
taza = press_button();
if (taza == 0)
{
return skzb;
}
if (taza == 1)
{
return 1;
}
skzb = taza;
break;
}
}
}
}
컴파일 시 표준 에러 (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... |