Submission #150169

# Submission time Handle Problem Language Result Execution time Memory
150169 2019-09-01T07:50:19 Z Ian and 2-bit memory(#3648, percywtc, nhho, ulna) King of Chairs (FXCUP4_chairs) C++17
87 / 100
165 ms 10440 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 W[0]*100 + W[1]*10 + W[2]*1;
}
#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 11 ms 1048 KB Correct
2 Correct 10 ms 1040 KB Correct
3 Correct 11 ms 1044 KB Correct
4 Correct 11 ms 1044 KB Correct
5 Correct 10 ms 1048 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 5940 KB Correct
2 Correct 110 ms 9636 KB Correct
3 Correct 114 ms 10440 KB Correct
4 Correct 113 ms 9924 KB Correct
5 Correct 122 ms 10436 KB Correct
6 Correct 117 ms 10440 KB Correct
7 Correct 115 ms 10440 KB Correct
# Verdict Execution time Memory Grader output
1 Partially correct 79 ms 5948 KB B = 35574178
2 Partially correct 165 ms 9668 KB B = 51036769
3 Partially correct 130 ms 10348 KB B = 45057563
4 Partially correct 163 ms 10436 KB B = 3993102
5 Partially correct 158 ms 10372 KB B = 43833533
6 Partially correct 159 ms 10428 KB B = 77981288
7 Partially correct 131 ms 10432 KB B = 73794780
8 Partially correct 121 ms 9912 KB B = 48756244