Submission #613146

# Submission time Handle Problem Language Result Execution time Memory
613146 2022-07-30T03:39:08 Z penguinhacker King of Chairs (FXCUP4_chairs) C++17
0 / 100
71 ms 6752 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+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

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 Runtime error 2 ms 512 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 56 ms 6684 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 71 ms 6752 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -