Submission #613171

# Submission time Handle Problem Language Result Execution time Memory
613171 2022-07-30T03:45:26 Z penguinhacker King of Chairs (FXCUP4_chairs) C++17
100 / 100
132 ms 12772 KB
#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});
}

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

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 time Memory Grader output
1 Correct 1 ms 512 KB Correct
2 Correct 1 ms 604 KB Correct
3 Correct 1 ms 604 KB Correct
4 Correct 1 ms 520 KB Correct
5 Correct 0 ms 516 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 50 ms 5308 KB Correct
2 Correct 94 ms 11580 KB Correct
3 Correct 91 ms 12552 KB Correct
4 Correct 101 ms 12540 KB Correct
5 Correct 98 ms 12532 KB Correct
6 Correct 87 ms 12584 KB Correct
7 Correct 107 ms 12652 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 59 ms 5388 KB Correct
2 Correct 109 ms 11740 KB Correct
3 Correct 92 ms 12540 KB Correct
4 Correct 125 ms 12648 KB Correct
5 Correct 132 ms 12672 KB Correct
6 Correct 125 ms 12772 KB Correct
7 Correct 106 ms 12524 KB Correct
8 Correct 105 ms 12532 KB Correct