| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 260594 | Ahmadsm2005 | 콤보 (IOI18_combo) | C++11 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define endl '\n'
#define modulo 200003
#define PI acos(-1)
#pragma GCC target ("avx2")
#pragma GCC optimize("trapv")
#define int long long
#define sinDegrees(x) sin((x) * PI / 180.0)
#define cosDegrees(x) cos((x) * PI / 180.0)
#define tanDegrees(x) tan((x) * PI / 180.0)
#define atanDegrees(x) atan(x)* 180.0 / PI
using namespace std;
int power(int x,int y,int m)
{
if(y<0)
return 0;
int temp;
if(y == 0)
return 1;
temp = (power(x, y/2,m))%m;
if (y%2 == 0)
return ((temp%m)*temp);
else
return ((x*temp%m)*temp%m)%m;
}
int inv(int x)
{
return (power(x,modulo-2,modulo))%modulo;
}
bool comp(int a,int b)
{
return a>b;
}
///solution created by: Ahmadsm2005
string guess_sequence(int n){
vector<char>lolz;
lolz.push_back('A'),lolz.push_back('B'),lolz.push_back('X'),lolz.push_back('Y');
n--;
char S;
string answer;
bool counter=0;
if(press("AB")){
if(press("A"))
S='A';
else
S='B';
}
else
if(press("X"))
S='X';
else
S='Y';
for(int i=0;i<4;i++)
if(lolz[i]==S){
lolz.erase(lolz.begin()+i);
break;
}
answer+=S;
while(n--){
if(n>1){
string SS=answer,SS2=answer,SS3=answer,SS4=answer;
SS+=lolz[0]+lolz[0],SS2+=lolz[0]+lolz[1],SS3+=lolz[0]+lolz[2],SS4+=lolz[1];
string combined=S+SS+S+SS2+S+SS3+S+SS4;
if(press(combined)==answer.size())
answer+=lolz[2];
else if(press(combined)==answer.size()+1)
answer+=lolz[1];
else
answer+=lolz[0];
}
else
if(press(answer+lolz[0])==answer.size()+1)
answer+=lolz[0];
else if(press(answer+lolz[1])==answer.size()+1)
answer+=lolz[1];
else
answer+=lolz[2];
}
return answer;
}
int32_t main()
{
//freopen("output.txt","w",stdout);
//freopen("a3.in","r",stdin);
cin.tie(0),iostream::sync_with_stdio(0);
return 0;
}
