Submission #148930

# Submission time Handle Problem Language Result Execution time Memory
148930 2019-09-01T05:24:46 Z TeamSUA(#3565, zimpha, sfiction, JTJL) King of Chairs (FXCUP4_chairs) C++17
95 / 100
166 ms 10456 KB
#include "king.h"

#include <bits/stdc++.h>

using namespace std;

long long SendInfo(vector<int> W, vector<int> C){
	sort(W.begin(), W.end());
	sort(C.begin(), C.end());

	int n = C.size();
	int ret = 0;
	for (int j = 0, i = 0; i < n && j < n; ++i){
		for (; j < n && C[j] < W[i]; ++j);
		if (j >= n)
			break;

		ret = W[i];
	}
	return ret;
}
#include "vassal.h"

#include <bits/stdc++.h>

using namespace std;

long long B;
set<pair<int, int>> C;

void Init(long long B, vector<int> C){
	::B = B;

	for (size_t i = 0; i < C.size(); ++i)
		::C.emplace(C[i], i);
}

int Maid(int W){
	if (W > B)
		return -1;

	auto p = C.lower_bound(make_pair(W, 0));
	if (p == C.end())
		return -1;
	
	int res = p->second;
	C.erase(p);
	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 11 ms 1044 KB Correct
2 Correct 10 ms 1044 KB Correct
3 Correct 11 ms 1044 KB Correct
4 Correct 10 ms 1052 KB Correct
5 Correct 10 ms 1040 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 5932 KB Correct
2 Correct 112 ms 9628 KB Correct
3 Correct 117 ms 10456 KB Correct
4 Correct 117 ms 10440 KB Correct
5 Correct 115 ms 10436 KB Correct
6 Correct 122 ms 10436 KB Correct
7 Correct 121 ms 10432 KB Correct
# Verdict Execution time Memory Grader output
1 Partially correct 83 ms 5948 KB B = 999992
2 Partially correct 153 ms 9632 KB B = 999980
3 Partially correct 140 ms 10180 KB B = 996891
4 Partially correct 161 ms 10440 KB B = 999968
5 Partially correct 163 ms 10436 KB B = 999982
6 Partially correct 166 ms 10436 KB B = 999987
7 Partially correct 139 ms 9936 KB B = 997852
8 Correct 118 ms 10440 KB Correct