답안 #151622

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
151622 2019-09-03T22:01:51 Z thebes King of Chairs (FXCUP4_chairs) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "king.h"
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

multiset<int> s;
vi id[1000006];

ll SendInfo(vi W,vi C){return 0;}
#include <bits/stdc++.h>
#include "vassal.h"
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

multiset<int> s;
vi id[1000006];

void Init(ll B,vi C){
    for(auto v : C) s.insert(v);
    for(int i=0;i<C.size();i++)
        id[C[i]].pb(i);
}

int maid(int w){
    auto it = s.lower_bound(w);
    if(it==s.end()) return -1;
    int idd = *it; s.erase(s.find(*it));
    int r = id[idd][0];
    id[idd].pop_front();
    return r;
}

Compilation message

vassal.cpp: In function 'void Init(ll, vi)':
vassal.cpp:14:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<C.size();i++)
                 ~^~~~~~~~~
vassal.cpp:15:18: error: 'vi {aka class std::vector<int>}' has no member named 'pb'
         id[C[i]].pb(i);
                  ^~
vassal.cpp: In function 'int maid(int)':
vassal.cpp:23:13: error: 'vi {aka class std::vector<int>}' has no member named 'pop_front'; did you mean 'front'?
     id[idd].pop_front();
             ^~~~~~~~~
             front