Submission #717661

#TimeUsernameProblemLanguageResultExecution timeMemory
717661VMaksimoski008Memory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" void play() { int candies = 0; char a, b; std::set<int> used; for(int i=1; i<=50; i++) { for(int j=1; j<=50; j++) { if(i != j && used.find(i) == used.end() && used.find(j) == used.end()) { a = faceup(i); b = faceup(j); if(a == b) { candies++; used.insert(i); used.insert(j); } if(candies == 25) return ; } } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:8:8: error: 'set' is not a member of 'std'
    8 |   std::set<int> used;
      |        ^~~
memory.cpp:3:1: note: 'std::set' is defined in header '<set>'; did you forget to '#include <set>'?
    2 | #include "memory.h"
  +++ |+#include <set>
    3 | 
memory.cpp:8:12: error: expected primary-expression before 'int'
    8 |   std::set<int> used;
      |            ^~~
memory.cpp:14:24: error: 'used' was not declared in this scope
   14 |           if(i != j && used.find(i) == used.end() && used.find(j) == used.end())
      |                        ^~~~