Submission #139580

#TimeUsernameProblemLanguageResultExecution timeMemory
139580Bazarkuly2003Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> //#include<string> //#include<cmath> //#include<conio.h> #define ll long long #define N 1000001 using namespace std; ll n; int press(string p){ } int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n; if(pass("A")==1){s="A";q="BXY";}else if(pass("B")==1){s="B";q="AXY";}else if(pass("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";} k=3; t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1]; while(s.size()<n){ m=pass(t); if(m==s.size()+0)s+=q[2];else if(m==s.size()+1)s+=q[1];else s+=q[0];} cout<<s; }

Compilation message (stderr)

combo.cpp: In function 'int press(std::string)':
combo.cpp:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^
combo.cpp: In function 'int main()':
combo.cpp:16:4: error: 'pass' was not declared in this scope
   16 | if(pass("A")==1){s="A";q="BXY";}else
      |    ^~~~
combo.cpp:16:18: error: 's' was not declared in this scope
   16 | if(pass("A")==1){s="A";q="BXY";}else
      |                  ^
combo.cpp:16:24: error: 'q' was not declared in this scope
   16 | if(pass("A")==1){s="A";q="BXY";}else
      |                        ^
combo.cpp:17:18: error: 's' was not declared in this scope
   17 | if(pass("B")==1){s="B";q="AXY";}else
      |                  ^
combo.cpp:17:24: error: 'q' was not declared in this scope
   17 | if(pass("B")==1){s="B";q="AXY";}else
      |                        ^
combo.cpp:18:18: error: 's' was not declared in this scope
   18 | if(pass("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";}
      |                  ^
combo.cpp:18:24: error: 'q' was not declared in this scope
   18 | if(pass("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";}
      |                        ^
combo.cpp:18:38: error: 's' was not declared in this scope
   18 | if(pass("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";}
      |                                      ^
combo.cpp:18:44: error: 'q' was not declared in this scope
   18 | if(pass("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";}
      |                                            ^
combo.cpp:19:1: error: 'k' was not declared in this scope
   19 | k=3;
      | ^
combo.cpp:20:1: error: 't' was not declared in this scope
   20 | t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1];
      | ^
combo.cpp:20:3: error: 's' was not declared in this scope
   20 | t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1];
      |   ^
combo.cpp:20:5: error: 'q' was not declared in this scope
   20 | t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1];
      |     ^
combo.cpp:22:1: error: 'm' was not declared in this scope
   22 | m=pass(t);
      | ^
combo.cpp:22:3: error: 'pass' was not declared in this scope
   22 | m=pass(t);
      |   ^~~~