제출 #682062

#제출 시각아이디문제언어결과실행 시간메모리
682062convexhulltrick콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include"combo.h" #include<string> #define p press std::string a="A",b="B",c="X",d="Y",k,e;auto guess_sequence=[](int N){int f=p(a+b),i=2;k+=f?p(a)?(e=a,a=d),e:(e=b,b=d),e:p(c)?(e=c,c=d),e:d;for(;i<N;i++)f=p(k+a+k+b+a+k+b+b+k+b+c),k+=f-i-1?f-i?c:a:b;i--;if(N-1)k+=p(k+a)-i?a:p(k+b)-i?b:c;return k;};

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

combo.cpp:4:46: error: 'auto guess_sequence' redeclared as different kind of entity
    4 | std::string a="A",b="B",c="X",d="Y",k,e;auto guess_sequence=[](int N){int f=p(a+b),i=2;k+=f?p(a)?(e=a,a=d),e:(e=b,b=d),e:p(c)?(e=c,c=d),e:d;for(;i<N;i++)f=p(k+a+k+b+a+k+b+b+k+b+c),k+=f-i-1?f-i?c:a:b;i--;if(N-1)k+=p(k+a)-i?a:p(k+b)-i?b:c;return k;};
      |                                              ^~~~~~~~~~~~~~
In file included from combo.cpp:1:
combo.h:5:13: note: previous declaration 'std::string guess_sequence(int)'
    5 | std::string guess_sequence(int N);
      |             ^~~~~~~~~~~~~~