이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define vi vector<int>
#define gi greater<int>
#define gr greater
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define pll pair<ll,ll>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF 1e9
#define eps 1e-7
#define eps1 1e-2
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 2e5+5
using namespace std;
const int MOD = 1e9+7;
const int nax = 1e6+5;
typedef complex<int> Point;
#define X real()
#define Y imag()
#include "combo.h"
char let[4] = {'A','B','X','Y'};
string guess_sequence(int n) {
string s = "";
int beg = 0;
if(press("A")) beg = 0,s = "A";
else if(press("B")) beg = 1,s= "B";
else if(press("X")) beg = 2,s = "X";
else beg = 3,s = "Y";
for (int i = 2; i <= n; ++i)
{
string cur = s+"X"+s+"YX"+s+"YY"+s+"YB";
int a = press(cur);
if(a == i-1) s+="B";
else if(a == i) s+="X";
else s += "Y";
}
return s;
}
컴파일 시 표준 에러 (stderr) 메시지
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:34:9: warning: variable 'beg' set but not used [-Wunused-but-set-variable]
34 | int beg = 0;
| ^~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |