Submission #988420

# Submission time Handle Problem Language Result Execution time Memory
988420 2024-05-24T16:22:41 Z cnn008 Rarest Insects (IOI22_insects) C++17
10 / 100
223 ms 600 KB
#include "bits/stdc++.h"
using namespace std;

#include "insects.h";

#ifdef N_N_C
#include "debug.h"
#else
#define cebug(...) "Arya"
#endif

#define ll long long

const int N=1e5+5;
const int mod=1e9+7;

int vis[1005],type;
int min_cardinality(int n){
	for(int i=0; i<n; i++){
		if(!vis[i]){
			vis[i]=++type;
			move_inside(i);
			for(int j=i+1; j<n; j++){
				move_inside(j);
				int val=press_button();
				if(val==2) vis[j]=type;
				move_outside(j);
			}
			move_outside(i);
		}
	}
	map <int,int> mp;
	for(int i=0; i<n; i++) mp[vis[i]]++;
	int ans=INT_MAX;
	for(auto [x,y]:mp) ans=min(ans,y);
	return ans;
}
/**  /\_/\
*   (= ._.)
*   / >💖 \>💕
**/

Compilation message

insects.cpp:4:21: warning: extra tokens at end of #include directive
    4 | #include "insects.h";
      |                     ^
insects.cpp:38:9: warning: "/*" within comment [-Wcomment]
   38 | /**  /\_/\
      |
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 500 KB Output is correct
4 Correct 1 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 103 ms 416 KB Output is correct
8 Correct 15 ms 344 KB Output is correct
9 Correct 10 ms 344 KB Output is correct
10 Correct 2 ms 344 KB Output is correct
11 Correct 53 ms 592 KB Output is correct
12 Correct 5 ms 344 KB Output is correct
13 Correct 11 ms 344 KB Output is correct
14 Correct 5 ms 344 KB Output is correct
15 Correct 7 ms 344 KB Output is correct
16 Correct 10 ms 596 KB Output is correct
17 Correct 14 ms 344 KB Output is correct
18 Correct 15 ms 344 KB Output is correct
19 Correct 27 ms 344 KB Output is correct
20 Correct 55 ms 420 KB Output is correct
21 Correct 67 ms 432 KB Output is correct
22 Correct 87 ms 420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 500 KB Output is correct
4 Correct 1 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 103 ms 416 KB Output is correct
8 Correct 15 ms 344 KB Output is correct
9 Correct 10 ms 344 KB Output is correct
10 Correct 2 ms 344 KB Output is correct
11 Correct 53 ms 592 KB Output is correct
12 Correct 5 ms 344 KB Output is correct
13 Correct 11 ms 344 KB Output is correct
14 Correct 5 ms 344 KB Output is correct
15 Correct 7 ms 344 KB Output is correct
16 Correct 10 ms 596 KB Output is correct
17 Correct 14 ms 344 KB Output is correct
18 Correct 15 ms 344 KB Output is correct
19 Correct 27 ms 344 KB Output is correct
20 Correct 55 ms 420 KB Output is correct
21 Correct 67 ms 432 KB Output is correct
22 Correct 87 ms 420 KB Output is correct
23 Correct 5 ms 344 KB Output is correct
24 Incorrect 223 ms 344 KB Too many queries.
25 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 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 Runtime error 9 ms 600 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -