(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #851212

#제출 시각아이디문제언어결과실행 시간메모리
851212Pajaraja콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
//#include "combo.h" #include <bits/stdc++.h> using namespace std; char c[4]={'A','B','X','Y'}; string guess_sequence(int N) { int koji=0; string s1="XY",s2="BY"; if(press(s1)) koji+=2; if(press(s2)) koji+=1; string s=""+c[koji]; vector<char> ch; for(int i=0;i<4;i++) if(i!=koji) ch.push_back(c[i]); if(N==1) return s; for(int i=2;i<N;i++) { string t=s+ch[0]+s+ch[1]+ch[0]+s+ch[1]+ch[1]+s+ch[1]+ch[2]; int x=press(t); if(x==i) s+=ch[2]; if(x==i+1) s+=ch[0]; if(x==i+2) s+=ch[1]; } string t1=s+ch[0],t2=s+ch[1],t3=s+ch[2]; if(press(t1)==N) return t1; if(press(t2)==N) return t2; return t3; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:8: error: 'press' was not declared in this scope
    9 |     if(press(s1)) koji+=2;
      |        ^~~~~
combo.cpp:10:8: error: 'press' was not declared in this scope
   10 |     if(press(s2)) koji+=1;
      |        ^~~~~
combo.cpp:18:15: error: 'press' was not declared in this scope
   18 |         int x=press(t);
      |               ^~~~~
combo.cpp:24:8: error: 'press' was not declared in this scope
   24 |     if(press(t1)==N) return t1;
      |        ^~~~~
combo.cpp:25:8: error: 'press' was not declared in this scope
   25 |     if(press(t2)==N) return t2;
      |        ^~~~~