Submission #150997

#TimeUsernameProblemLanguageResultExecution timeMemory
150997JustInCaseKing of Chairs (FXCUP4_chairs)C++17
100 / 100
177 ms12608 KiB
#include <bits/stdc++.h> #include "king.h" #define send_info SendInfo #define int32_t int #define int64_t long long int64_t send_info(std::vector< int32_t > w, std::vector< int32_t > c) { std::sort(w.begin(), w.end()); int32_t indW = w.size() - 1, indC = c.size() - 1, ans = 0; while(indW >= 0 && indC >= 0) { if(c[indC] >= w[indW]) { ans++; indW--; indC--; } else { indW--; } } return 0; }
#include <bits/stdc++.h> #include "vassal.h" #define init Init #define maid Maid #define int32_t int #define int64_t long long std::set< std::pair< int32_t, int32_t > > s; void init(int64_t b, std::vector< int32_t > c) { for(int32_t i = c.size() - 1; i >= 0; i--) { s.insert({ c[i], i }); } } int32_t maid(int32_t w) { auto it = s.lower_bound({ w, 0 }); if(it != s.end()) { int32_t ans = it->second; s.erase(it); return ans; } return -1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...