Submission #377138

#TimeUsernameProblemLanguageResultExecution timeMemory
377138kevinxiehkMemory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include<memory.h> #include<grader.h> #ifdef __cplusplus extern "C" { #endif char faceup(int C); void play(); #ifdef __cplusplus } #endif #include<bits/stdc++.h> using namespace std; // TODO: global variables can be declared here map<char,vector<int>>mp; void play() { for(int i=1;i<=50;i++)mp[faceup(i)].push_back(i); for(char c='A';c<='Y';c++){faceup(mp[c][0]);faceup(mp[c][1]);} return; }

Compilation message (stderr)

memory.cpp:6:6: error: conflicting declaration of 'char faceup(int)' with 'C' linkage
    6 | char faceup(int C);
      |      ^~~~~~
In file included from memory.cpp:2:
grader.h:1:6: note: previous declaration with 'C++' linkage
    1 | char faceup(int C);
      |      ^~~~~~
memory.cpp:7:6: error: conflicting declaration of 'void play()' with 'C' linkage
    7 | void play();
      |      ^~~~
In file included from memory.cpp:1:
memory.h:1:6: note: previous declaration with 'C++' linkage
    1 | void play();
      |      ^~~~