Submission #148160

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1481602019-08-31 15:42:03연구맨 (#201)Get Hundred Points! (FXCUP4_hundred)C++17
Compilation error
0 ms0 KiB
#include <stdio.h>
#include <stdlib.h>
#include "hundred.h"
static void my_assert(int TF, const char* message){
if(!TF){ puts(message); exit(0); }
}
static int A = 0, B = 0, C = 0;
static std::string ans;
static int call_cnt = 0;
int Mark(std::string S){
call_cnt++;
my_assert(call_cnt <= 100, "Wrong: Too Much Calls");
my_assert(S.size() == 100, "Wrong: Invalid S");
int fin, As, Bs, Cs;
fin = As = Bs = Cs = 0;
for(int i = 0; i < 100; i++){
my_assert(S[i] == 'A' || S[i] == 'B' || S[i] == 'C', "Wrong: Invalid S");
if(S[i] == 'A') As++;
if(S[i] == 'B') Bs++;
if(S[i] == 'C') Cs++;
if(S[i] == ans[i]) fin++;
}
my_assert(As == A && Bs == B && Cs == C, "Wrong: Invalid S");
return fin;
}
int main(){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

/tmp/ccakjhVp.o: In function `Mark(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x20): multiple definition of `Mark(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/tmp/cc5aBgeb.o:hundred.cpp:(.text+0x10): first defined here
/tmp/ccakjhVp.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc5aBgeb.o:hundred.cpp:(.text.startup+0x0): first defined here
/tmp/cc5aBgeb.o: In function `main':
hundred.cpp:(.text.startup+0x136): undefined reference to `GetHundredPoints[abi:cxx11](int, int, int)'
/tmp/ccakjhVp.o: In function `main':
grader.cpp:(.text.startup+0x45): undefined reference to `GetHundredPoints[abi:cxx11](int, int, int)'
collect2: error: ld returned 1 exit status