Submission #148690

#TimeUsernameProblemLanguageResultExecution timeMemory
148690Torat (#200)King of Chairs (FXCUP4_chairs)C++17
95 / 100
196 ms15224 KiB
#include "king.h" #include <bits/stdc++.h> using namespace std; long long SendInfo(vector<int> w,vector<int> c) { sort(w.begin(),w.end()); multiset<int> s; for (int i:c) s.insert(i); int cur=0; for (int i:w) { auto it=s.lower_bound(i); if (it==s.end()) break; cur=max(cur,i); s.erase(it); } return cur; }
#include "vassal.h" #include <bits/stdc++.h> using namespace std; long long mx; set<pair<int,int> > ch; void Init(long long b,vector<int> c) { for (int i=0;i<c.size();i++) ch.insert({c[i],i}); mx=b; } int Maid(int w) { if (w>mx) return -1; auto it=ch.lower_bound({w,0}); if (it==ch.end()) return -1; int ret=it->second; ch.erase(it); return ret; }

Compilation message (stderr)

vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:8:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i=0;i<c.size();i++)
               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...