답안 #602429

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
602429 2022-07-23T05:50:49 Z MrDeboo Art Collections (BOI22_art) C++17
컴파일 오류
0 ms 0 KB
#include "art.h"
#include <bits/stdc++.h>
using namespace std;
int n;
int sbmt(int a){
    vector<int>v;
    for(int i=1;i<=n;i++){
        if(i==a)continue;
        v.push_back(i);
    }
    v.push_back(a);
    return publish(v);
}
int sbmtt(int a){
    vector<int>v;
    v.push_back(a);
    for(int i=1;i<=n;i++){
        if(i==a)continue;
        v.push_back(i);
    }
    return publish(v);
}
void solve(int N){
    while(1){
        sbmit(1);
    }
    n=N;
    vector<pair<int,int>>v;
    for(int i=1;i<=n;i++)v.push_back({sbmtt(i),i});
    sort(v.begin(),v.end());
    vector<int>ans;
    for(auto &i:v)ans.push_back(i.second);
    answer(ans);
}

Compilation message

art.cpp: In function 'void solve(int)':
art.cpp:25:9: error: 'sbmit' was not declared in this scope; did you mean 'sbmtt'?
   25 |         sbmit(1);
      |         ^~~~~
      |         sbmtt
interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~