Submission #1074350

# Submission time Handle Problem Language Result Execution time Memory
1074350 2024-08-25T09:58:54 Z Nicolaikrob Rarest Insects (IOI22_insects) C++17
0 / 100
1 ms 344 KB
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;

int min_cardinality(int n) {
	vi T(n), C(n, 1);
	for(int i = 0; i < n; i++) T[i] = i;
	for(int i = 0; i < n; i++) {
		if(T[i] != i) continue;
		move_inside(i);
		for(int j = i+1; j < n; j++) {
			move_inside(j);
			int t = press_button();
			if(t == 1) T[j] = T[i], C[i]++, C[j] = n;
			move_outside(j);
		}
		move_outside(i);
	}
	int mn = n;
	for(auto x : C) mn = min(x, mn);
	return mn;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -