Submission #1283390

#TimeUsernameProblemLanguageResultExecution timeMemory
1283390muhammad-mutahirCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

#define print(l) for(auto i:l) cout<<i<<" ";cout<<endl;
#define input(t,l,n) vector<t>l(n);for(int i = 0;i<n;i++)cin>>l[i];
#define int long long
#define pb push_back
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define all(l) l.begin(),l.end()
#define pii pair<int,int>
#define fi first
#define se second

const int M = 1e9+7;
const int inf = 1e18;


int bp(int x, int y, int p){
    int res = 1;
    x = x % p;
    while (y > 0) {
 
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
 
int MI(int n, int p){
    return bp(n, p - 2, p);
}
int mul(int x,int y, int p){
    return x * 1ull * y % p;
}
int di(int x,int y, int p){
    return mul(x, MI(y, p), p);
}


int n , m , k , q;
// ABXYY
// int press(string s,int ii = 0){
	// // string k = "ABXYY";
	// int k ;
// 	
	// cout<<s<<endl;
	// cin>>k;
	// return k;
	// // return (s[ii] == k[ii]);
// }

string guess_sequence(int N) {
	string cr = "";
	int k = press("A");
	// cout<<k<<endl;
	if(k){
		cr+="A";
	}
	else{
		k = press("B");
		if(k){
			cr+="B";
		}else{
			k = press("X");
			if(k){
				cr+="X";
			}
			else{
				cr+="Y";
			}
		}
	}
// f = "A"
// s = 
// t
// f
	string f = cr;
	vector<string>pos = {"A","B","X","Y"};
	vector<string>rem;
	for(auto i:pos){
		if(i != cr)rem.pb(i);
	}
	
	// cr+s+f + cr+t+s+f + cr+t+t+f + cr+t+fo 
	int cl = 1;
	for(int i = 1;i<N;i++){
		// cout<<cr+rem[0]<<" "<<f<<" "<<cr+rem[1]+rem[0]<<" "<<f<<" "<<cr+rem[1]+rem[1]<<" "<<f<<" "<<cr+rem[1]+rem[2]<<endl;
		int k = press(cr+rem[0]+f + cr+rem[1]+rem[0]+f + cr+rem[1]+rem[1]+f + cr+rem[1]+rem[2]);
		// cout<<k<<endl;
		if(k == cl){
			cr+=rem[2];
		}
		else if(k == cl+1){
			cr+=rem[0];
		}
		else if(k == cl+2){
			cr+=rem[1];
		}
		cl++;
		// cout<<"current : "<<cr<<endl;
	}
	return cr;
// A 0
// B 0
// x 1
	
}

// signed main(){
    // ios::sync_with_stdio(0);//DO NOT USE IN INTERACTIVE
    // cin.tie(0), cout.tie(0);
    // cout << fixed<<setprecision(9);
//     
    // cout<<guess_sequence(5)<<endl;
// }

Compilation message (stderr)

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