답안 #964416

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
964416 2024-04-16T19:36:24 Z marinaluca Super Dango Maker (JOI22_dango3) C++17
컴파일 오류
0 ms 0 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
namespace{
  
int asa = 1;
void Solve (vector <int> v, int x){
    if (x == 1){
        Answer(ans);
        return;
    }
    int mijl = x / 2;
    vector <int> rez;
    for (int i = v.size(); -- i;){
        swap (v[i], v.back());
        int y = v.back();
        v.pop_back();
        if (Query(v) < mijl)
            v.push_back(y);
        else
            rez.push_back(y);
    }
    Solve (v, mijl);
    Solve(rez, x - mijl);
}
}
 
void solve (int N, int M){
    vector <int> v;
    for (int i = 0; i < N * M; ++ i){
        v.push_back(i + 1);
    }
    solve(v, M);
}
/**
signed main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    return 0 ^ 0;
}
**/

Compilation message

dango3.cpp: In function 'void {anonymous}::Solve(std::vector<int>, int)':
dango3.cpp:9:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |         Answer(ans);
      |                ^~~
      |                abs
dango3.cpp: In function 'void solve(int, int)':
dango3.cpp:33:11: error: cannot convert 'std::vector<int>' to 'int'
   33 |     solve(v, M);
      |           ^
      |           |
      |           std::vector<int>
dango3.cpp:28:17: note:   initializing argument 1 of 'void solve(int, int)'
   28 | void solve (int N, int M){
      |             ~~~~^
dango3.cpp: At global scope:
dango3.cpp:6:5: warning: '{anonymous}::asa' defined but not used [-Wunused-variable]
    6 | int asa = 1;
      |     ^~~