제출 #169439

#제출 시각아이디문제언어결과실행 시간메모리
169439NucleistThe Big Prize (IOI17_prize)C++14
20 / 100
2 ms444 KiB
#include "prize.h"
#include <bits/stdc++.h> 
using namespace std; 
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define INF 1000000000
#define MOD 1000000007
#define pb push_back
#define ve vector<ll>
#define dos pair<ll,ll>
#define vedos vector<dos>
#define rand mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
struct greateri
{
    template<class T>
    bool operator()(T const &a, T const &b) const { return a > b; }
};
int find_best(int n)
{
  int low=0;
  int high=n-1;
  while(low<=high)
  {
    int med = (low+high)/2;
    vector<int> go = ask(med);
    if(go[0]==go[1])
    {
      return med;
    }
    else if(go[0]==1)
    {
      high=med-1;
    }
    else low=med+1;
  }
}
//code the AC sol !
// BS/queue/map

컴파일 시 표준 에러 (stderr) 메시지

prize.cpp:5:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization ("O3")
 
prize.cpp:6:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization ("unroll-loops")
 
prize.cpp: In function 'int find_best(int)':
prize.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...