답안 #773890

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
773890 2023-07-05T09:19:28 Z lollipop Hotter Colder (IOI10_hottercolder) C++17
52 / 100
417 ms 8232 KB
#include "grader.h"
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
//#define int long long
#define pb push_back
#define s second
#define f first
#define pf push_front
#define inf 100000000000000000
#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 = 2e5 + 10 ;
mt19937 R(time(0));
map < int , int > ma , ma1 ;
int bn1[ 11 ] , bn2[ 11 ] , bn3[ 11 ] ;
int HC( int N ){
    int l = 1 ;
    int z = Guess( 1 ) ;
    int r = N ;
    int lst = -1 ;
    while( l < r ){
        int mid = ( l + r ) / 2 ; 
        if( lst == -1 ){
            int x = Guess( r ) ;
            if( x == 1 ){
                l = mid + 1 ; 
             //   Guess( l ) ; 
                lst = 1 ; 
                continue ; 
            } 
            if( x == -1 ){
                int tt = 0 ; 
                if( ( r + l ) % 2 == 0 ) tt = 1 ; 
                r = mid - tt ;
                int ff = Guess( l ) ; 
                lst = -1 ; 
                continue ;
            }
            if( x == 0 ){
                return mid ; 
                continue ; 
            }
        }
        else{
            int x = Guess( l ) ;
                if( x == 1 ){
                    r = mid ; 
                    lst = -1 ; 
                    continue ; 
              } 
                if( x == -1 ){
                  l = mid + 1 ;
                  int ff = Guess( l ) ; 
                  lst = - 1 ; 
                  continue ;
              }
                if( x == 0 ){
                    return mid ; 
                    continue ; 
                }            
        }
    }
    return l ; 
}




Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:53:21: warning: unused variable 'ff' [-Wunused-variable]
   53 |                 int ff = Guess( l ) ;
      |                     ^~
hottercolder.cpp:71:23: warning: unused variable 'ff' [-Wunused-variable]
   71 |                   int ff = Guess( l ) ;
      |                       ^~
hottercolder.cpp:36:9: warning: unused variable 'z' [-Wunused-variable]
   36 |     int z = Guess( 1 ) ;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 1304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 1308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 19 ms 1236 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 417 ms 8232 KB Output is partially correct - alpha = 0.076923076923