Submission #613146

#TimeUsernameProblemLanguageResultExecution timeMemory
613146penguinhackerKing of Chairs (FXCUP4_chairs)C++17
0 / 100
71 ms6752 KiB
#include "king.h" #include <bits/stdc++.h> using namespace std; long long SendInfo(vector<int> w, vector<int> c) { /*int n=w.size(); sort(w.begin(), w.end()); int lb=0, rb=n; while(lb<rb) { int mid=(lb+rb+1)/2; bool ok=1; for (int i=0; i<mid; ++i) ok&=w[i]<=c[n-mid+i]; if (ok) lb=mid; else rb=mid-1; } return lb;*/ return 0; }
#include "vassal.h" #include <bits/stdc++.h> using namespace std; #define ar array //long long B; set<ar<int, 2>> st; void Init(long long _B, vector<int> C) { for (int i=0; i<C.size(); ++i) st.insert({C[i], i+1}); } int Maid(int W) { auto it=st.lower_bound({W}); if (it==st.end()) return -1; int x=(*it)[1]; st.erase(it); return x; }

Compilation message (stderr)

vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:12:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  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...