Submission #149718

# Submission time Handle Problem Language Result Execution time Memory
149718 2019-09-01T07:01:10 Z Solo Leveling (#3786, wzy) King of Chairs (FXCUP4_chairs) C++17
0 / 100
89 ms 5916 KB
#include "king.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;


long long SendInfo(std::vector<int> W, std::vector<int> C) {

	vector<int> orig = C;
	sort(W.begin() , W.end());
	sort(C.rbegin() , C.rend());
	int last = 0;
	for(int i = 0 ; i <  W.size() ; i ++){
		while(C.size() && C.back() < W[i]){
			C.pop_back();
		}
		if(!C.size()){
			last = W[i];
			break;
		}
	}
	return last;
}	
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int> 
#define F first
#define S second
long long BB;
	
set<pii> Sx;

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

int Maid(int W){
	if(W >= BB){
		return -1;
	}
	else{
		auto u = Sx.lower_bound(pii(W , -1));
		pii X = *u;
		Sx.erase(X);
		return X.second;
	}
}

Compilation message

king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:13:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0 ; i <  W.size() ; i ++){
                  ~~^~~~~~~~~~~

vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:14:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i =0 ; i < C.size() ; i ++){
                 ~~^~~~~~~~~~
vassal.cpp:12:6: warning: unused variable 'N' [-Wunused-variable]
  int N = C.size();
      ^
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 1040 KB Wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 5788 KB Wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 89 ms 5916 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -