Submission #827044

# Submission time Handle Problem Language Result Execution time Memory
827044 2023-08-16T08:20:18 Z lollipop Rarest Insects (IOI22_insects) C++17
10 / 100
318 ms 336 KB
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define ll long long
//#define int long long
#define pb push_back
#define s second
#define f first
#define pf push_front
#define inf 1000000000000000
#define bitebi __builtin_popcountll
#define FOR( i , n ) for( int i = 0 ; i < n ; i ++ )
#define YES cout <<"YES\n"
#define NO cout << "NO\n"
#define debug cout << "Here Fine" << endl ;
#define pr pair < int , int >
#define fbo find_by_order // returns iterator
#define ook order_of_key // returns strictly less numbers than key
using namespace std ;
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
const double Pi=acos(-1.0);
const double EPS=1E-8;
const int mod =  1000000007 ;
const int mod1 = 998244353 ;
const int N = 4e5 + 10 ;
//mt19937 R(time(0));
map < string , int > ma , ma1 ;
     
#include "insects.h"

// void move_inside(int i){
//   return 0 ;
// }
// void move_outside(int i){
// return 0 ;
// }
// int press_button(){
// return 0 ;
// }


int min_cardinality(int N){
   int tp[ N ] ;
   FOR( i , N ) tp[ i ] = 0 ;
   int cc = 1 , mn = INT_MAX ;
   int count = 0 ;
   vector < int > v ;
   FOR( i , N ) v.pb( i ) ;
   random_shuffle( v.begin() , v.end() ) ;
    random_shuffle( v.begin() , v.end() ) ;
   for( int I = 0 ; I < N ; I ++ ){
    int i = v[ I ] ; 
     if( tp[ i ] != 0 ) continue ;
     if( tp[ i ] == 0 ){
      tp[ i ] = cc ; cc ++ ;
     }     
     int cnt = 1 ;
     if( cnt >= mn ) continue ;
     move_inside( i ) ;
     count ++ ;
      if( count == 40000 ) return mn ;
     for( int J = I + 1 ; J < N ; J ++ ){
      int j = v[ J ] ;
       if( tp[ j ] != 0  ) continue ;
       move_inside( j ) ;
       count ++ ;
       if( count == 40000 ) return mn ;
       int cc = press_button() ;
       if( cc == 2 ){
        cnt ++ ;
        tp[ j ] = tp[ i ] ;
       }
       move_outside( j ) ;
    //   if( cnt >= mn ) break ;
     }
     mn = min( mn , cnt ) ;
     move_outside( i ) ; 
   }
   return mn ;
}

# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 0 ms 336 KB Output is correct
6 Correct 2 ms 208 KB Output is correct
7 Correct 2 ms 208 KB Output is correct
8 Correct 13 ms 208 KB Output is correct
9 Correct 10 ms 208 KB Output is correct
10 Correct 2 ms 208 KB Output is correct
11 Correct 4 ms 208 KB Output is correct
12 Correct 5 ms 208 KB Output is correct
13 Correct 11 ms 208 KB Output is correct
14 Correct 4 ms 208 KB Output is correct
15 Correct 5 ms 208 KB Output is correct
16 Correct 10 ms 208 KB Output is correct
17 Correct 8 ms 208 KB Output is correct
18 Correct 8 ms 208 KB Output is correct
19 Correct 16 ms 208 KB Output is correct
20 Correct 23 ms 208 KB Output is correct
21 Correct 2 ms 208 KB Output is correct
22 Correct 4 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 0 ms 336 KB Output is correct
6 Correct 2 ms 208 KB Output is correct
7 Correct 2 ms 208 KB Output is correct
8 Correct 13 ms 208 KB Output is correct
9 Correct 10 ms 208 KB Output is correct
10 Correct 2 ms 208 KB Output is correct
11 Correct 4 ms 208 KB Output is correct
12 Correct 5 ms 208 KB Output is correct
13 Correct 11 ms 208 KB Output is correct
14 Correct 4 ms 208 KB Output is correct
15 Correct 5 ms 208 KB Output is correct
16 Correct 10 ms 208 KB Output is correct
17 Correct 8 ms 208 KB Output is correct
18 Correct 8 ms 208 KB Output is correct
19 Correct 16 ms 208 KB Output is correct
20 Correct 23 ms 208 KB Output is correct
21 Correct 2 ms 208 KB Output is correct
22 Correct 4 ms 208 KB Output is correct
23 Correct 9 ms 208 KB Output is correct
24 Correct 9 ms 208 KB Output is correct
25 Correct 90 ms 208 KB Output is correct
26 Correct 64 ms 208 KB Output is correct
27 Correct 8 ms 208 KB Output is correct
28 Correct 9 ms 208 KB Output is correct
29 Correct 19 ms 208 KB Output is correct
30 Correct 99 ms 208 KB Output is correct
31 Correct 17 ms 208 KB Output is correct
32 Correct 17 ms 208 KB Output is correct
33 Correct 38 ms 208 KB Output is correct
34 Correct 46 ms 208 KB Output is correct
35 Correct 50 ms 208 KB Output is correct
36 Correct 53 ms 208 KB Output is correct
37 Correct 145 ms 208 KB Output is correct
38 Correct 281 ms 208 KB Output is correct
39 Incorrect 205 ms 208 KB Wrong answer.
40 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 0 ms 208 KB Output is correct
6 Correct 0 ms 208 KB Output is correct
7 Correct 11 ms 208 KB Output is correct
8 Correct 14 ms 208 KB Output is correct
9 Partially correct 292 ms 208 KB Output is partially correct
10 Partially correct 197 ms 208 KB Output is partially correct
11 Correct 11 ms 208 KB Output is correct
12 Correct 18 ms 208 KB Output is correct
13 Correct 43 ms 208 KB Output is correct
14 Incorrect 318 ms 208 KB Wrong answer.
15 Halted 0 ms 0 KB -