# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
98855 | brcode | 콤보 (IOI18_combo) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
using namespace std;
string guess_sequence(int n){
string s;
s = "AB";
if(press(s)){
if(press("A")){
s = "A";
}else{
s = "B";
}
}else{
if(press("X")){
s = "X";
}else{
s = "Y";
}
}
vector<string> choices;
if(s!="X"){
choices.push_back("X");
}
if(s!="Y"){
choices.push_back("Y");
}
if(s!="A"){
choices.push_back("A");
}
if(s!="B"){
choices.push_back("B");
}
while(s.length()<n){
if(s.length() == n-1){
if(press(s+choices[0]) == n){
s+=choices[0];
break;
}else if(press(s+choices[1]) == n){
s+=choices[1];
break;
}else{
s+=choices[2];
break;
}
}
string q;
q+= (s+choices[0]+choices[0]);
q+= (s+choices[0]+choices[1]);
q+=(s+choices[1]+choices[0]);
int pressed = press(q);
if(pressed == s.length()+2){
string p = s+choices[0]+choices[0];
int hold = press(p);
if(hold == s.length()+2){
s+=choices[0]+choices[0];
continue;
}else if(hold == s.length()+1){
s+=choices[0]+choices[1];
continue;
}else{
s+=choices[1]+choices[0];
continue;
}
}else if(pressed == s.length() + 1){
string p = s+choices[1]+choices[1];
int hold = pressed(p);
if(hold == s.length() + 2){
s+=choices[1]+choices[1];
continue;
}else if(hold == s.length() + 1){
s+=choices[1]+choices[2];
continue;
}else{
s+=choices[0]+choices[2];
}
}else{
s+=choices[2];
}
}
return s;
}
int main() {
int a, b;
cin >> a >> b;
cout << a + b;
return 0;
}