Submission #1750208


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

inline int read()
{
	int x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
	return x*f;
}
int A,B,stt[6000],top=0; string tt;
int main()
{
	A=read(); B=read();
	if(A<=B) {puts("Impossible"); return 0;}
	for(int i=0;i<A+B;i++)
	{
		if(top==0) {stt[++top]=i; continue;}
		printf("? %d %d\n",stt[top],i);
		cin >> tt;
		if(tt[0]=='Y') stt[++top]=i;
		else top--;
	}
	cout << "! "
	for(int i=0;i<A+B;i++) 
	{
		printf("? %d %d\n",stt[top],i);
		cin >> tt;
		putchar(tt[0]=='Y'? '1':'0');
	}
	puts("");
	return 0;
}

Submission Info

Submission Time
Task F - HonestOrUnkind
User wcz111
Language C++14 (GCC 5.4.1)
Score 0
Code Size 679 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:26:2: error: expected ‘;’ before ‘for’
  for(int i=0;i<A+B;i++) 
  ^
./Main.cpp:26:14: error: ‘i’ was not declared in this scope
  for(int i=0;i<A+B;i++) 
              ^