제출 #717679

#제출 시각아이디문제언어결과실행 시간메모리
717679VMaksimoski008Memory (IOI10_memory)C++14
컴파일 에러
0 ms0 KiB
include "grader.h" #include "memory.h" #include <set> void play() { int candies = 0; std::map<char, int> mapa; for(int i=1; i<=50; i++) { char ch = faceup(i); mapa[ch]++; if(mapa[ch] == 2) candies++: if(candies == 25) return ; } }

컴파일 시 표준 에러 (stderr) 메시지

memory.cpp:1:1: error: 'include' does not name a type
    1 | include "grader.h"
      | ^~~~~~~
memory.cpp: In function 'void play()':
memory.cpp:9:10: error: 'map' is not a member of 'std'
    9 |     std::map<char, int> mapa;
      |          ^~~
memory.cpp:4:1: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
    3 | #include <set>
  +++ |+#include <map>
    4 | 
memory.cpp:9:14: error: expected primary-expression before 'char'
    9 |     std::map<char, int> mapa;
      |              ^~~~
memory.cpp:13:19: error: 'faceup' was not declared in this scope
   13 |         char ch = faceup(i);
      |                   ^~~~~~
memory.cpp:14:9: error: 'mapa' was not declared in this scope
   14 |         mapa[ch]++;
      |         ^~~~
memory.cpp:16:22: error: expected ';' before ':' token
   16 |             candies++:
      |                      ^
      |                      ;