Submission #339222

# Submission time Handle Problem Language Result Execution time Memory
339222 2020-12-24T21:10:15 Z Kerim Combo (IOI18_combo) C++17
0 / 100
1 ms 200 KB
#include "combo.h"
#include "bits/stdc++.h"
using namespace std;
string tmp="ABXY";
string guess_sequence(int N) {
	string ans="T",avl;
	for(int i=0;i<3;i++){
		ans[0]=tmp[i];
		if(press(ans))break;
	}if(ans=="T")ans=tmp[3];
  	if(N==1)
      	return ans;
	for(int i=0;i<4;i++)
		if(ans[0]!=tmp[i])
			avl+=tmp[i];
	tmp=avl;
	for(int i=2;i<N;i++){
		int val=press(ans+tmp[0]+tmp[1]+tmp[0]+tmp[1]+tmp[1]+tmp[1]+tmp[2]);
		if(val==i)ans+=tmp[0];	
		else if(val>i)ans+=tmp[1];
		else ans+=tmp[2];
	}
	if(press(ans+tmp[0])==N)return ans+tmp[0];
	if(press(ans+tmp[1])==N)return ans+tmp[1];
	return ans+tmp[2];
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Incorrect 1 ms 200 KB Wrong Answer: wrong guess.
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Incorrect 1 ms 200 KB Wrong Answer: wrong guess.
5 Halted 0 ms 0 KB -