답안 #1077420

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077420 2024-08-27T07:03:21 Z Muhammad_Aneeq 드문 곤충 (IOI22_insects) C++17
0 / 100
106 ms 424 KB
void move_inside(int i);
void move_outside(int i);
int press_button();
#include <iostream>
#include <vector>
using namespace std;
int min_cardinality(int N)
{
	bool vis[N]={};
	int ans=N;
	for (int i=0;i<N;i++)
	{
		if (vis[i])
			continue;
		vis[i]=1;
		vector<int>f;
		f.push_back(i);
		move_inside(i);
		int cnt=1;
		for (int j=i+1;j<N;j++)
		{
			if (vis[j])
				continue;
			cnt++;
			move_inside(j);
			if (press_button()==cnt)
			{
				vis[j]=1;
				continue;
				f.push_back(j);
			}
			move_outside(j);
			cnt--;
		}
		for (auto j:f)
			move_outside(j);
		ans=min(cnt,ans);
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 99 ms 424 KB Output is correct
8 Incorrect 106 ms 344 KB Wrong answer.
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 99 ms 424 KB Output is correct
8 Incorrect 106 ms 344 KB Wrong answer.
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Incorrect 0 ms 344 KB Wrong answer.
7 Halted 0 ms 0 KB -