답안 #1117327

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1117327 2024-11-23T10:12:48 Z somefolk Password (RMI18_password) C++14
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <complex>
#include <list>
#include <chrono>
#include <random>
#include <stack>
#include <iomanip>
#include <fstream>
using namespace std;

#define endl "\n"
// #define int long long

const int INF = 2 * 1e5 + 5;
const int MOD = 1e9 + 7;

int query(string s);

void guess(int n, int s){
    vector<char> a;
    for(char i = 0; i < s; i++){
        if(query(string(1, i+'a'))) a.push_back(i+'a');
    }

    map<char, int> pass;

    for(int i = 0; i < (int)a.size(); i++){
        int l = 0;
        for(int j = 0; j < (int)a.size(); j++){
            if(a[i] == a[j]) continue;
            if(query(string(1,a[i])+a[j]) == 1) l++;
        }
        pass[a[i]] = l;
    }

    map<int, char> sol;
    for(auto &i : pass){
        sol[i.second] = i.first;
    }

    for(auto &i : sol){
        cout << i.second;
    }
}

Compilation message

/usr/bin/ld: /tmp/cc1tAZZV.o: in function `main':
grader.cpp:(.text.startup+0x66): undefined reference to `guess[abi:cxx11](int, int)'
collect2: error: ld returned 1 exit status