제출 #717661

#제출 시각아이디문제언어결과실행 시간메모리
717661VMaksimoski008Memory (IOI10_memory)C++14
컴파일 에러
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 ; } } } }

컴파일 시 표준 에러 (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())
      |                        ^~~~