제출 #493051

#제출 시각아이디문제언어결과실행 시간메모리
493051_adis콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
/*input

*/
/*inhuman strength
#pragma GCC optimize("O2,unroll-loops")
#pragma GCC target("avx,avx2")
*/
#include<bits/stdc++.h>
#define foR(i,a,b) for(int i=a;i<=b;i++)
#define roF(i,a,b) for(int i=a;i>=b;i--)
#define _ff exit(0);
#define Sort(i,a,b) sort(i+a,i+a+b)
#define SORT(i,a,b) sort(i+a,i+a+b,greater<int>())
#define code_chef for(int i=1,x=0;i<=100000;i++){x++;cerr<<x;}
#define TLE cerr<<"\n" <<  1.0*clock()/CLOCKS_PER_SEC << "\n";
#define F first
#define S second
#define sperm(a) next_permutation(a.begin(),a.end());
#define all(a) a.begin(),a.end()
#define nxhieu_speed cin.tie(0)->sync_with_stdio(false);
#define i2 pair<int,int>
#define getbit(x,i) ((x>>(i))&1)
#define batbit(x,i) (x|(1ll<<(i)))
#define tatbit(x,i) (x&~(1<<(i)))
#define RTE cout<<-1;_ff
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l, int r) {return l + rng() % (r - l + 1);}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
struct Triple
{
	int Fi;
	int Se;
	int Th;
};
bool operator >(Triple A, Triple B)
{
	if (A.Fi == B.Fi && A.Se == B.Se) return (A.Th > B.Th);
	if (A.Fi == B.Fi && A.Se != B.Se) return (A.Se > B.Se);
	return (A.Fi > B.Fi);
}
bool operator <(Triple A, Triple B)
{
	if (A.Fi == B.Fi && A.Se == B.Se) return (A.Th < B.Th);
	if (A.Fi == B.Fi && A.Se != B.Se) return (A.Se < B.Se);
	return (A.Fi < B.Fi);
}
bool operator ==(Triple A, Triple B)
{
	return (A.Fi == B.Fi && A.Se == B.Se && A.Th == B.Th);
}
int Money;
void solve()
{
	int n;
	cin >> n;
	string s;
	cout << "AB" << '\n';
	cout.flush();
	vector<char> S;
	cin >> Money;
	if (Money == 1)
	{
		cout << "A";
		cout.flush();
		cin >> Money;
		if (Money == 1)
		{
			S.push_back('B');
			S.push_back('X');
			S.push_back('Y');
			s = s + 'A';
		}
		else
		{
			S.push_back('A');
			S.push_back('X');
			S.push_back('Y');
			s = s + 'B';
		}
	}
	else {
		cout << 'X';
		cout.flush();
		cin >> Money;
		if (Money == 1)
		{
			s = s + 'X';
			S.push_back('B');
			S.push_back('A');
			S.push_back('Y');
		}
		else
		{
			s = s + 'Y';
			S.push_back('B');
			S.push_back('X');
			S.push_back('A');
		}
	}
	for (int i = 1; i < n; ++i)
	{
		cout << s << S[0] << s << S[1] << S[0] << s << S[1] << S[1] << s << S[1] << S[2] << '\n';
		cout.flush();
		cin >> Money;
		if(Money==s.size()+1) s=s+S[0];
		else if(Money==s.size()+2) s=s+S[1];
		else s=s+S[2]; 
	}
	cout << s;
}
int main()
{
	nxhieu_speed
	int t = 1;
	//cin >> t;
	while (t-- > 0) solve();
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'void solve()':
combo.cpp:107:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |   if(Money==s.size()+1) s=s+S[0];
      |      ~~~~~^~~~~~~~~~~~
combo.cpp:108:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  108 |   else if(Money==s.size()+2) s=s+S[1];
      |           ~~~~~^~~~~~~~~~~~
/usr/bin/ld: /tmp/ccvTb4eA.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cctATCsD.o:combo.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccvTb4eA.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status