| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 93366 | temoyanteladze | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int n)
{
	string s="",ch="";
	string v="ABCD";
	if (press("A"))
	{
		s=ch="A";
	}
	if (press("B"))
	{
		s=ch="B";
	}
	if (press("X"))
	{
		s=ch="X";
	}
	if (press("Y"))
	{
		s=ch="Y";
	}
	int k=v.find(ch);
	v.erase(s.begin()+k);
	for (int i=2;i<=n;i++)
    {
    	int p=press(ans+v[0]+ans+v[1]+v[0]+ans+v[1]+v[1]+ans+v[1]+v[2]);
    	if (p==i)
    	s+=v[0];
    	if (p==i+1)
    	s+=v[1];
    	if (p==i-1)
    	s+=v[2];
	}
return s;
}
