#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);
}
/*
for(int i = 0 ; i < (int)C.size(); i++) {
C_rev.emplace_back(C[i], i);
C_.emplace_back(C[i], 0);
}
sort(C_.begin(), C_.end());
sort(C_rev.begin(), C_rev.end());
*/
}
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();
return x;
}
}
/*
if (it == C_.end())
it--;
if(it!=C_.begin()){
auto itt = it;
itt--;
if((itt->first) >= W && (itt->second)== 0) {
it--;
}
}
if ((it->first) >= W && (it->second) == 0) {
int i = it-C_.begin();
it->second = 1;
return (C_rev[i].second);
}
*/
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
1060 KB |
Correct |
2 |
Incorrect |
10 ms |
1056 KB |
Wrong |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
111 ms |
39024 KB |
Wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
138 ms |
39656 KB |
Wrong |
2 |
Halted |
0 ms |
0 KB |
- |