Submission #1270108

#TimeUsernameProblemLanguageResultExecution timeMemory
1270108almaz콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

#define int long long
// #define endl '\n'
#define ff first
#define ss second
#define pb push_back
#define all(a) a.begin(), a.end()

const int MOD = 1e9 + 7,INF = 1e18;

string guess_sequence(int n) {
	ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string s = "";
	string ans = "";
	
	string a , b , c;
	
	cout<<"press(AB)"<<'\n'<<flush;
	int t;
	cin >> t;
	
	if(t > 0){
		cout<<"press(A)"<<'\n'<<flush;
		int f;
		cin >> f;
		
		if(f == 1){
			ans += "A";
			a = "B";
			b = "X";
			c = "Y";
		}
		else{
			ans += "B";
			a = "A";
			b = "X";
			c = "Y";
		}
	}
	
	else{
		cout<<"press(X)"<<'\n'<<flush;
		int f;
		cin >> f;
		
		if(f == 1){
			ans += "X";
			a = "B";
			b = "A";
			c = "Y";
		}
		else{
			ans += "Y";
			a = "B";
			b = "X";
			c = "A";
		}	
	}
	
	for(int i = 1; i < n;i++){
		cout<<"press(ans + a + a + ans + a + b + ans + b + c)"<<'\n' << flush;
		int h;
		cin >> h;
		
		h -= ans.size();
		
		if(h == 0){
			ans += c;
		}
		if(h == 1){
			cout<<"press(ans + b + b)"<<'\n'<<flush;
			int j;
			cin >> j;
			
			j -= ans.size();
			
			if(j == 0){
				ans += a + b;
			}
			if(j == 1){
				ans += b + a;
			}
			if(j == 2){
				ans += b + b;
			}
			i++;
		}
		if(h == 2){
			cout<<"press(ans + a + a)"<<'\n'<<flush;
			int j;
			cin >> j;
			
			j -= ans.size();
			
			if(j == 0){
				ans += b + c;
			}
			if(j == 1){
				ans += a + b;
			}
			if(j == 2){
				ans += a + a;
			}
			i++;
		}
	}
	
	return ans;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccN9fg9d.o: in function `main':
grader.cpp:(.text.startup+0x4b): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status