Submission #148633

# Submission time Handle Problem Language Result Execution time Memory
148633 2019-09-01T04:49:27 Z 욱방켜!! (twitch.tv/wookje)(#3584, kig9981, cheetose, jh05013) King of Chairs (FXCUP4_chairs) C++17
55 / 100
185 ms 15220 KB
#include "king.h"
#include <bits/stdc++.h>

long long SendInfo(std::vector<int> W, std::vector<int> C) {
	int N = W.size();
	std::multiset<int> CC(C.begin(),C.end());
	std::sort(W.begin(),W.end());
	for(int i=0;i<N;i++) {
		auto it=CC.lower_bound(W[i]);
		if(it==CC.end()) return W[i]-1;
		CC.erase(it);
	}
	return W[N-1];
}
#include "vassal.h"
#include <bits/stdc++.h>

long long BB;
std::set<std::pair<int,int>> S;

void Init(long long B, std::vector<int> C){
	int N = C.size();
	BB = B;
	for(int i=0;i<N;i++) S.insert({C[i],i});
}

int Maid(int W){
	int ret;
	auto it=S.lower_bound(std::make_pair(W,-1));
	if(W>BB || it==S.end()) return -1;
	ret=it->second;
	S.erase(it);
	return ret;
}
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1048 KB Correct
2 Correct 11 ms 1044 KB Correct
3 Correct 10 ms 792 KB Correct
4 Correct 11 ms 1040 KB Correct
5 Correct 10 ms 1044 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 78 ms 8144 KB Correct
2 Correct 134 ms 13772 KB Correct
3 Correct 139 ms 15220 KB Correct
4 Correct 146 ms 14956 KB Correct
5 Correct 143 ms 14704 KB Correct
6 Correct 146 ms 14716 KB Correct
7 Correct 142 ms 14632 KB Correct
# Verdict Execution time Memory Grader output
1 Partially correct 98 ms 8136 KB B = 993890
2 Partially correct 165 ms 14036 KB B = 996221
3 Partially correct 172 ms 15212 KB B = 706117
4 Incorrect 185 ms 15216 KB Wrong
5 Halted 0 ms 0 KB -