제출 #300568

#제출 시각아이디문제언어결과실행 시간메모리
300568aymane7콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "combo.h" #pragma GCC optimize("O2") #define S second #define F first #define PB push_back #define sz(x) (int) x.size() #define all(x) x.begin(),x.end() #define L(x) 2*x #define R(x) 2*x+1 #define M(x,y) (x+y)/2 using namespace std; typedef long long ll; /* int press(string s){ cout<<s <<"?"<<endl; int ans; cin>>ans; return ans; } */ string guess_sequence(int n){ vector<string> pos; string ans; string f; if(press("A")){ ans="A"; pos.PB("B"); pos.PB("X"); pos.PB("Y"); } else if(press("B")){ ans="B"; pos.PB("A"); pos.PB("X"); pos.PB("Y"); } else if(press("X")){ ans="X"; pos.PB("A"); pos.PB("B"); pos.PB("Y"); } else{ ans="Y"; pos.PB("A"); pos.PB("B"); pos.PB("X"); } for(int i=2;i<=n-1;i++){ string query=ans+pos[0]+ans+pos[1]+pos[0] +ans+pos[1]+pos[1] +ans+pos[1]+pos[2]; int q=press(query); if(q==sz(ans)){ ans+=pos[2]; } else if(q==sz(ans)+1){ ans+=pos[0]; } else ans+=pos[1]; } if(press(ans+"A")==n){ ans+="A"; } else if(press(ans+"B")==n){ ans+="B"; } else if(press(ans+"X")==n){ ans+="X"; } else{ ans+="Y"; } return ans; } int main(){ cout<<guess_sequence(4); }

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

/usr/bin/ld: /tmp/ccQwMAhh.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccU8o26g.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status