제출 #861956

#제출 시각아이디문제언어결과실행 시간메모리
861956JakobZorzStone Arranging 2 (JOI23_ho_t1)C++17
컴파일 에러
0 ms0 KiB
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<limits.h>
#include<math.h>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<iomanip>
typedef long long ll;
typedef long double ld;
using namespace std;
const int MOD=1e9+7;
//typedef pair<ll,ll>Point;
//typedef pair<ll,ll>Line;
//#define x first
//#define y second

int main(){
    ios::sync_with_stdio(false);
    cout.tie(NULL);
    cin.tie(NULL);
    
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    
    int n;
    cin>>n;
    vector<int>arr(n);
    unordered_multiset<int>s;
    for(int&i:arr){
        cin>>i;
        s.insert(i);
    }
    
    for(int i=0;i<n;){
        s.erase(s.find(arr[i]));
        if(s.contains(arr[i])){
            int val=arr[i];
            i++;
            while(arr[i]!=val)
                arr[i++]=val;
        }else
            i++;
    }
    
    for(int i:arr)
        cout<<i<<"\n";
    
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:41:14: error: 'class std::unordered_multiset<int>' has no member named 'contains'
   41 |         if(s.contains(arr[i])){
      |              ^~~~~~~~