Submission #1205834

#TimeUsernameProblemLanguageResultExecution timeMemory
1205834kitkat12Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
// Problem URL: https://oj.uz/problem/view/IOI18_combo // Start Time: 5/22/2025, 1:37:39 PM #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define mp make_pair #define pb push_back #define F first #define S second #define debug(x) std::cout << #x << ": " << x << "\n" #define all(v) v.begin(), v.end() #define li(i,a,b) for (int i = a; i < b; i++) #define endl '\n' #define mem(name,val) memset(name,val,sizeof(name)) #define min(a,b) (a<=b ? a : b) #define max(a,b) (a>=b ? a : b) int press(string s){ return 1; } string guess_sequence(int n){ string pref = "X"; // guess first letter int res = press("XY"); switch (res) { case 1: res = press("XA"); if(!res) pref = "Y"; break; case 0: pref="A"; res = press("AX"); if(!res) pref = "B"; break; default: break; } li(i,1,n-1){ stringstream q; q << pref << "A" << pref << "YY" << pref <<"YA"<<pref<<"YB"; res = press(q.str()); if(res==i+1){ pref.append("B"); } else if(res == i+2){ pref.append("A"); } else{ pref.append("Y"); } } stringstream q; q << pref <<"Y"<<pref<<"A"; res = press(q.str()); if(res==n-1){ pref.append("B"); } else{ q.clear(); q << pref <<"Y"; res = press(q.str()); if(res == n){ pref.append("Y"); } else{ pref.append("A"); } } return pref; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccrdIQMl.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccQoJrY7.o:combo.cpp:(.text+0x60): first defined here
collect2: error: ld returned 1 exit status