Submission #149424

# Submission time Handle Problem Language Result Execution time Memory
149424 2019-09-01T06:27:38 Z Little Piplup(#3742, gratus907, DHdroid, coffeetea99) King of Chairs (FXCUP4_chairs) C++17
100 / 100
299 ms 6224 KB
#include "king.h"

long long SendInfo(std::vector<int> W, std::vector<int> C) 
{
	int N = W.size();
	return 0;
}
#include "vassal.h"
#include <algorithm>
long long BB;
std::vector <int> Chairs;
bool fullchair[101010];
void Init(long long B, std::vector<int> C)
{
	int N = C.size();
	BB = B;
	Chairs = C;
	sort(Chairs.begin(),Chairs.end());
}

int Maid(int W)
{
	int N = Chairs.size();
	int u = std::lower_bound(Chairs.begin(),Chairs.end(),W)-Chairs.begin();
	while(u < N && fullchair[u])
	{
		u++;
	}
	if (u == N)
	{
		return -1;
	}
	else 
	{
		fullchair[u] = 1;
		return u;
	}
}

Compilation message

king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:5:6: warning: unused variable 'N' [-Wunused-variable]
  int N = W.size();
      ^

vassal.cpp: In function 'void Init(long long int, std::vector<int>)':
vassal.cpp:8:6: warning: unused variable 'N' [-Wunused-variable]
  int N = C.size();
      ^
# Verdict Execution time Memory Grader output
1 Correct 11 ms 1056 KB Correct
2 Correct 11 ms 1056 KB Correct
3 Correct 10 ms 1060 KB Correct
4 Correct 10 ms 1052 KB Correct
5 Correct 10 ms 1056 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 64 ms 3688 KB Correct
2 Correct 114 ms 5804 KB Correct
3 Correct 299 ms 6208 KB Correct
4 Correct 103 ms 6216 KB Correct
5 Correct 118 ms 6096 KB Correct
6 Correct 117 ms 6212 KB Correct
7 Correct 289 ms 6216 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 63 ms 3704 KB Correct
2 Correct 118 ms 5808 KB Correct
3 Correct 286 ms 6212 KB Correct
4 Correct 132 ms 6224 KB Correct
5 Correct 140 ms 6212 KB Correct
6 Correct 117 ms 6216 KB Correct
7 Correct 281 ms 6216 KB Correct
8 Correct 95 ms 6092 KB Correct