답안 #487105

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
487105 2021-11-14T10:13:57 Z Karuk Password (RMI18_password) C++17
컴파일 오류
0 ms 0 KB
#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;
    }
}

Compilation message

/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