This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "king.h"
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
long long SendInfo(std::vector<int> W, std::vector<int> C) {
return 0LL;
}
#include "vassal.h"
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <deque>
using namespace std;
//vector<pair<int,int>> C_rev;
//vector<pair<int,int>> C_;
map<int,deque<int>> s;
void Init(long long B, std::vector<int> C){
for (int i = 0 ; i < (int)C.size();i++) {
if(s.count(C[i]) == 0) {
s[C[i]] = deque<int>();
}
s[C[i]].push_back(i);
}
}
int Maid(int W){
auto it = s.lower_bound(W);
if(it!=s.end()) {
if (!(it->second).empty()) {
int x = (it->second).front();
(it->second).pop_front();
if((it->second).empty()){
s.erase(it);
}
return x;
}
} else {
return -1;
}
}
Compilation message (stderr)
vassal.cpp: In function 'int Maid(int)':
vassal.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |