Submission #1012226

#TimeUsernameProblemLanguageResultExecution timeMemory
1012226zsomborMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" using namespace std; void play() { string s = "#"; for (int i = 1; i <= 50; i++) s.push_back(faceup(i)); for (int i = 1; i <= 50; i++) { for (int j = i + 1; j <= 50; j++) { if (s[i] == s[j]) { faceup(i); faceup(j); } } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:6:2: error: 'string' was not declared in this scope
    6 |  string s = "#";
      |  ^~~~~~
memory.cpp:3:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
    2 | #include "memory.h"
  +++ |+#include <string>
    3 | using namespace std;
memory.cpp:7:32: error: 's' was not declared in this scope
    7 |  for (int i = 1; i <= 50; i++) s.push_back(faceup(i));
      |                                ^
memory.cpp:10:8: error: 's' was not declared in this scope
   10 |    if (s[i] == s[j]) { faceup(i); faceup(j); }
      |        ^