Submission #150185

# Submission time Handle Problem Language Result Execution time Memory
150185 2019-09-01T07:51:27 Z Ian and 2-bit memory(#3648, percywtc, nhho, ulna) King of Chairs (FXCUP4_chairs) C++17
100 / 100
163 ms 10484 KB
#include "king.h"
#include <bits/stdc++.h>
using namespace std;

long long SendInfo(std::vector<int> W, std::vector<int> C) {
	int N = W.size();
	return 0;
}
#include "vassal.h"
#include <bits/stdc++.h>
using namespace std;

long long BB;

typedef pair<int, int> P;

#define ft first
#define sd second

set<P> s;

void Init(long long B, std::vector<int> C){
	int N = C.size();
	BB = B;

	s.clear();

	for (int i = 0; i < N; i++) {
		s.insert(P(C[i], i));
	}
}

int Maid(int W){
	auto ite = s.lower_bound(P(W, -1));
	
	if (ite == s.end()) return -1;

	int res = ite->sd;

	s.erase(ite);

	return res;
}

Compilation message

king.cpp: In function 'long long int SendInfo(std::vector<int>, std::vector<int>)':
king.cpp:6:6: warning: unused variable 'N' [-Wunused-variable]
  int N = W.size();
      ^
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1040 KB Correct
2 Correct 12 ms 1196 KB Correct
3 Correct 10 ms 1044 KB Correct
4 Correct 11 ms 1036 KB Correct
5 Correct 11 ms 1296 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 5944 KB Correct
2 Correct 118 ms 9616 KB Correct
3 Correct 127 ms 10444 KB Correct
4 Correct 115 ms 10420 KB Correct
5 Correct 113 ms 10436 KB Correct
6 Correct 131 ms 10432 KB Correct
7 Correct 118 ms 10436 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 86 ms 5940 KB Correct
2 Correct 146 ms 9628 KB Correct
3 Correct 141 ms 10432 KB Correct
4 Correct 160 ms 10484 KB Correct
5 Correct 149 ms 10432 KB Correct
6 Correct 163 ms 10436 KB Correct
7 Correct 136 ms 10404 KB Correct
8 Correct 129 ms 10444 KB Correct