# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149008 | Seishun Buta Yarou wa Yumemiru Shoujo no Yume wo Minai (#200) | Wine Tasting (FXCUP4_wine) | C++17 | 11 ms | 1060 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bartender.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> BlendWines(int k, vector<int> r) {
vector<int> a;
for(int i=0; i<r.size(); ++i) {
--r[i];
if(!r[i])
a.push_back(11);
else
a.push_back(r[i]%10+1);
}
return a;
}
#include "taster.h"
#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> c[12];
//i<j
bool cmp(int i, int j) {
if(i>=n||j>=n)
return i<j;
return Compare(i, j)<0;
}
vector<int> SortWines(int k, vector<int> a) {
n=a.size();
for(int i=a.size(); i<30; ++i)
a.push_back(i%10+1);
vector<int> b(30);
for(int i=0; i<30; ++i)
c[a[i]].push_back(i);
b[c[11][0]]=1;
if(!cmp(c[1][0], c[1][1]))
swap(c[1][0], c[1][1]);
b[c[1][0]]=11;
b[c[1][1]]=21;
for(int i=2; i<11; ++i) {
//find 2
if(cmp(c[1][1], c[i][0]))
swap(c[i][0], c[i][2]);
else if(cmp(c[1][1], c[i][1]))
swap(c[i][1], c[i][2]);
//find 1
if(cmp(c[1][0], c[i][0]))
swap(c[i][0], c[i][1]);
for(int j=0; j<3; ++j)
b[c[i][j]]=j*10+i;
}
return vector<int>(b.begin(), b.begin()+n);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |