Submission #717679

# Submission time Handle Problem Language Result Execution time Memory
717679 2023-04-02T10:43:42 Z VMaksimoski008 Memory (IOI10_memory) C++14
Compilation error
0 ms 0 KB
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 ;
    }
  
}

Compilation message

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++:
      |                      ^
      |                      ;