제출 #1283892

#제출 시각아이디문제언어결과실행 시간메모리
1283892hoangnoobproCombo (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define mod 1000000007 #define nmax 1000007 #define fi first #define se second #define ll int ll t=1,n,m,i,j,d=0,x=0,k=0,y,z,a[nmax],f[nmax]; string S,s1; vector<char>v; char t1,t2,t3,t4; int press(string p) { } string guess_sequence(int N) { S="AB"; x=press(S); if(x==1) { S="A"; y=press(S); if(y==1)t1='A'; else t1='B'; } else { S="X"; y=press(S); if(y==1)t1='X'; else t1='Y'; } S=""; S+=t1; for(i='A';i<='Z';++i) { if(i=='A'||i=='B'||i=='X'||i=='Y') { if(i!=t1) { v.push_back(char(i)); } } } for(i=2;i<=N;++i) { s1=S; s1+=v[0]; s1+=S;s1+=v[1];s1+=v[0]; s1+=S;s1+=v[1];s1+=v[1]; s1+=S;s1+=v[1];s1+=v[2]; x=press(s1); if(x==S.size()+1) { S+=v[0]; continue; } if(x==S.size()) { S+=v[2]; continue; } S+=v[1]; continue; } return S; }

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

combo.cpp: In function 'int press(std::string)':
combo.cpp:15:1: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | }
      | ^
/usr/bin/ld: /tmp/cc65aVII.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/ccWMJru6.o:combo.cpp:(.text.unlikely+0x0): first defined here
collect2: error: ld returned 1 exit status