Rating changes for the last round are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
40930214 Practice:
mak_2002
1010B - 68 GNU C++17 Wrong answer on test 1 15 ms 0 KB 2018-07-30 02:19:46 2018-07-30 02:19:46
 
 
→ Source
#include<bits/stdc++.h>
#define fi first
#define se second
#define	all(c) (c).begin(),(c).end()
#define sz(c) (c).size
#define cl ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
const int M = 1e9+7 , N = 1e5+5;
bool b[35];
int n ,m , t;
void bs(int st , int en , int c)
{
	if(st>=n || en>=n || st>en)return;
	int mid = (st+en)/2;
	fflush(stdout);
	printf("%d\n" , mid);
	fflush(stdout);
	scanf("%d" , &t);
	if(!t || t==-2)exit(0);
	if(!b[c])t*=-1;
	if(t==-1) return bs(st, mid-1 , (c+1)%n);
	return bs(mid+1,en , (c+1)%n);
}
int main(int argc, char const *argv[])
{

	memset(b , 0 , sizeof b);
	scanf("%d %d"  , &m , &n);
	for(int i = 0 ; i <n ; i++)
	{
		fflush(stdout);
		printf("1\n");
		fflush(stdout);
		scanf("%d" , &t);
		if(!t || t==-2)exit(0);
		else if(t==1)b[i]=1;
		//scanf("%d", &b[i]);
	}
	bs(2 , m ,0);
} 
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details