제출 #487105

#제출 시각아이디문제언어결과실행 시간메모리
487105KarukPassword (RMI18_password)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include "grader.cpp"
using namespace std;
string guess(int n , int k)
{
    string s;
    for(int i=0;i<n;i++)
    {
        s+='a';
    }
    while(1)
    {
        for(int i=0;i<n;i++)
        {
            if(s[i]==k+'a'-1)s[i]='a';
            else {s[i]++;i=n+1;}
        }
        int x=query(s);
        if(x==n)return s;
    }
}

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

/usr/bin/ld: /tmp/cchWxQ75.o: in function `query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x80): multiple definition of `query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccp1KI27.o:password.cpp:(.text+0x80): first defined here
/usr/bin/ld: /tmp/cchWxQ75.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccp1KI27.o:password.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status