Submission #150293

# Submission time Handle Problem Language Result Execution time Memory
150293 2019-09-01T08:04:53 Z Welcome to osu!(#3734, easrui, CodePlatina, jhwest2) Wine Tasting (FXCUP4_wine) C++17
0 / 100
10 ms 908 KB
#include "bartender.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<int> BlendWines(int K, std::vector<int> R){
	int N = R.size();
	vector<int> ret(N);

	for (int i=0; i<N; i++)
		ret[i] = (R[i]+2)/3;

	return ret;
}
#include "taster.h"
#include <bits/stdc++.h>
using namespace std;


vector<int> B;
vector<int> arr;

bool cmp(int a, int b) {
	--a, --b;
	if (B[a] != B[b]) return B[a] < B[b];
	return arr[a] < arr[b];
}
std::vector<int> SortWines(int K, std::vector<int> A) {
	int N = A.size();
	B=A;
	arr.resize(N);

	for (int i=0; i<N; i++) {
		for (int j=0; j<i; j++) {
			if (A[i] != A[j]) continue;

			if (Compare(i, j) == 1) arr[i]++;
			else arr[j]++;
		}
	}

	vector<int> ret;
	for (int i=1; i<=N; i++)
		ret.push_back(N+1-i);

	sort(ret.begin(), ret.end(), cmp);

	return ret;
}
# Verdict Execution time Memory Grader output
1 Correct 9 ms 908 KB Correct
2 Correct 10 ms 908 KB Correct
3 Incorrect 10 ms 836 KB Wrong
4 Halted 0 ms 0 KB -