답안 #148412

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148412 2019-09-01T04:19:51 Z Little Piplup(#3742, gratus907, DHdroid, coffeetea99) King of Chairs (FXCUP4_chairs) C++17
87 / 100
291 ms 6304 KB
#include "king.h"

long long SendInfo(std::vector<int> W, std::vector<int> C) 
{
	int N = W.size();
	return W[0]*100 + W[1]*10 + W[2]*1;
}
#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();
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 544 KB Correct
2 Correct 10 ms 1052 KB Correct
3 Correct 10 ms 1056 KB Correct
4 Correct 10 ms 1060 KB Correct
5 Correct 10 ms 548 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 57 ms 3708 KB Correct
2 Correct 110 ms 5800 KB Correct
3 Correct 275 ms 6304 KB Correct
4 Correct 111 ms 6220 KB Correct
5 Correct 115 ms 6060 KB Correct
6 Correct 114 ms 6220 KB Correct
7 Correct 278 ms 6216 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 67 ms 3696 KB B = 35574178
2 Partially correct 123 ms 5804 KB B = 51036769
3 Partially correct 286 ms 6220 KB B = 45057563
4 Partially correct 127 ms 6220 KB B = 3993102
5 Partially correct 142 ms 6216 KB B = 43833533
6 Partially correct 119 ms 6208 KB B = 77981288
7 Partially correct 291 ms 6140 KB B = 73794780
8 Partially correct 93 ms 5588 KB B = 48756244