Submission #505860

#TimeUsernameProblemLanguageResultExecution timeMemory
505860Carmel_Ab1King of Chairs (FXCUP4_chairs)C++17
38 / 100
128 ms17296 KiB
#include "king.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; ll SendInfo(vi W, vi C) { multiset<int>s; int n=C.size(); for(int i=0; i<n; i++) s.insert(C[i]); int ans=0; for(int i=0; i<n; i++){ auto it=s.lower_bound(W[i]); if(it==s.end())break; s.erase(it); ans++; } return ans; }
#include "vassal.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int,int>pi; int pref=0; multiset<pi>s; void Init(ll B, vi C){ pref=B; int n=C.size(); for(int i=0; i<n; i++) s.insert({C[i],i}); } int Maid(int W){ if(!pref)return -1; --pref; auto it=s.upper_bound({W,-1}); int ans=it->second; s.erase(it); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...