제출 #140099

#제출 시각아이디문제언어결과실행 시간메모리
140099davitmarg커다란 상품 (IOI17_prize)C++17
20 / 100
3 ms380 KiB
//DM
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include "prize.h"
#define LL long long
#define mod 1000000007ll
#define MP make_pair
#define PB push_back
#define all(v) v.begin(),v.end()
using namespace std;



int find_best(int n)
{
	int l=0,r=n-1,m,pos;
	while(l<=r)
	{
		m=(l+r)/2;
		if(!ask(m)[0])
		{
			pos=m;
			l=m+1;
		}
		else
			r=m-1;
		
	}
	return pos;
}

/* 
int main()
{

	return 0;
}

*/

/*







*/

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:36:9: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return pos;
         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...