Submission #149416

#TimeUsernameProblemLanguageResultExecution timeMemory
149416usa1+samsung2 (#200)King of Chairs (FXCUP4_chairs)C++17
100 / 100
330 ms74328 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...