제출 #377138

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

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