답안 #1064532

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1064532 2024-08-18T14:07:38 Z sunboi 곤돌라 (IOI14_gondola) C++14
컴파일 오류
0 ms 0 KB

#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;



int valid(int n, int inputSeq[]){
    vector<int> a;
    int mn = 1e9;
    set<int> val;
    for (int i = 0; i < n; i++){
        mn = min(mn, inputSeq[i]);
        val.insert(inputSeq[i]);
    }
    
    for (int i = 0; i < n; i++){
        if (inputSeq[i] == mn) a.push_back(mn);
        else if (!a.mepty()){
            a.push_back(inputSeq[i]);
        }
        
    }
    
    for (int i = 0; i < n; i++){
        if (inputSeq[i] == mn) break;
        a.push_back(inputSeq[i]);
    }
    int cnt = a[0];
    int f = 0;
    for (int i = 0; i < n; i++){
        if (cnt == a[i] || a[i] >= n + 1) continue;
        f = 1;
    }
    if (inputSeq.size() != n) f = 1;
    return f;
}


int replacement(int n, int gondolaSeq[], int replacementSeq[]){
    return 0;
}
int countReplacement(int n, int inputSeq[]){
    return 0;
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:20:21: error: 'class std::vector<int>' has no member named 'mepty'; did you mean 'empty'?
   20 |         else if (!a.mepty()){
      |                     ^~~~~
      |                     empty
gondola.cpp:36:18: error: request for member 'size' in 'inputSeq', which is of non-class type 'int*'
   36 |     if (inputSeq.size() != n) f = 1;
      |                  ^~~~