Submission #92972

#TimeUsernameProblemLanguageResultExecution timeMemory
92972temoyanteladzeCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;

string guess_sequence(int n)
{
    string s;
    string ch;
        if (press("A"))
    {
        s+="A";
        ch="A";

    }
        if (press("B"))
         {
          s+="B";
          ch="B";
          }

         if (press("X"))
         {

            s+="X";
            ch="X";
         }
        if (press("Y"))
        {
              s+="Y";
              ch="Y";
        }
     for (int i=2;i<=n;i++)
     {
         string c;

         c=s+"A";
         if (ch!="A")
         if (press(c)==i)
            s+="A";
            c=s;
            c+="B";
        if (ch!="B")
         if (press(c)==i)
            s+="B";
             c=s;
            c+="X";
            if (ch!="X")
          if (press(x)==i)
             s+="X";
           c=s;
            c+="Y";
             if (ch!="Y")
            if (press(x)==i)
             s+="Y";
     }
    }
        return s;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:38:10: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   38 |          if (press(c)==i)
      |          ^~
combo.cpp:40:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   40 |             c=s;
      |             ^
combo.cpp:48:21: error: 'x' was not declared in this scope
   48 |           if (press(x)==i)
      |                     ^
combo.cpp:53:23: error: 'x' was not declared in this scope
   53 |             if (press(x)==i)
      |                       ^
combo.cpp:56:5: warning: no return statement in function returning non-void [-Wreturn-type]
   56 |     }
      |     ^
combo.cpp: At global scope:
combo.cpp:57:9: error: expected unqualified-id before 'return'
   57 |         return s;
      |         ^~~~~~
combo.cpp:58:1: error: expected declaration before '}' token
   58 | }
      | ^