#include "bartender.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> BlendWines(int k, vector<int> r){
int n = r.size();
if(k<10){
for(int i=0;i<n;i++){
r[i]=1;
}
return r;
}
vector<int> v;
for(int i=0;i<n;i++){
r[i]=r[i]%10+1;
}
return r;
}
#include "taster.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> SortWines(int k, vector<int> a) {
int n = a.size();
vector<int> v[11],ans;
ans.resize(n);
for(int i=0;i<n;i++){
v[a[i]].push_back(i);
}
for(int i=1;i<=10;i++){
if(v[i].size()==0) continue;
else if(v[i].size()==1){
ans[v[i][0]]=i;
}
else if(v[i].size()==2){
if(Compare(v[i][0],v[i][1])>0) swap(v[i][0],v[i][1]);
ans[v[i][0]]=i;
ans[v[i][1]]=i+10;
}
else{
for(int t=0;t<3;t++){
for(int j=0;j<t;j++){
if(Compare(v[i][j],v[i][t])>0) swap(v[i][t],v[i][j]);
}
}
for(int t=0;t<3;t++) ans[v[i][t]]=i+10*t;
}
}
for(int i=0;i<n;i++){
if(ans[i]%10==1) ans[i]=ans[i]+9;
else ans[i]=ans[i]-1;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
772 KB |
Correct |
2 |
Correct |
9 ms |
772 KB |
Correct |
3 |
Correct |
10 ms |
772 KB |
Correct |
4 |
Correct |
9 ms |
772 KB |
Correct |
5 |
Correct |
9 ms |
908 KB |
Correct |
6 |
Correct |
9 ms |
772 KB |
Correct |
7 |
Correct |
8 ms |
644 KB |
Correct |
8 |
Correct |
9 ms |
644 KB |
Correct |
9 |
Correct |
9 ms |
784 KB |
Correct |
10 |
Correct |
9 ms |
908 KB |
Correct |
11 |
Correct |
10 ms |
780 KB |
Correct |
12 |
Correct |
10 ms |
780 KB |
Correct |
13 |
Correct |
10 ms |
932 KB |
Correct |
14 |
Correct |
10 ms |
644 KB |
Correct |
15 |
Correct |
8 ms |
784 KB |
Correct |
16 |
Correct |
9 ms |
908 KB |
Correct |
17 |
Correct |
10 ms |
920 KB |
Correct |
18 |
Correct |
9 ms |
908 KB |
Correct |
19 |
Correct |
11 ms |
780 KB |
Correct |
20 |
Correct |
11 ms |
1016 KB |
Correct |
21 |
Correct |
10 ms |
784 KB |
Correct |
22 |
Correct |
10 ms |
780 KB |
Correct |
23 |
Correct |
14 ms |
884 KB |
Correct |
24 |
Correct |
10 ms |
1012 KB |
Correct |
25 |
Correct |
8 ms |
896 KB |
Correct |
26 |
Correct |
9 ms |
908 KB |
Correct |
27 |
Correct |
9 ms |
780 KB |
Correct |
28 |
Correct |
8 ms |
1028 KB |
Correct |
29 |
Correct |
8 ms |
792 KB |
Correct |
30 |
Correct |
9 ms |
908 KB |
Correct |
31 |
Correct |
8 ms |
772 KB |
Correct |
32 |
Correct |
10 ms |
784 KB |
Correct |
33 |
Correct |
9 ms |
908 KB |
Correct |
34 |
Correct |
10 ms |
780 KB |
Correct |
35 |
Correct |
9 ms |
772 KB |
Correct |
36 |
Correct |
12 ms |
776 KB |
Correct |
37 |
Correct |
11 ms |
780 KB |
Correct |
38 |
Correct |
9 ms |
772 KB |
Correct |
39 |
Correct |
8 ms |
772 KB |
Correct |
40 |
Correct |
9 ms |
888 KB |
Correct |
41 |
Correct |
9 ms |
772 KB |
Correct |
42 |
Correct |
9 ms |
772 KB |
Correct |
43 |
Correct |
10 ms |
908 KB |
Correct |
44 |
Correct |
8 ms |
1020 KB |
Correct |
45 |
Correct |
10 ms |
772 KB |
Correct |
46 |
Partially correct |
8 ms |
772 KB |
Wrong |
47 |
Partially correct |
9 ms |
676 KB |
Wrong |
48 |
Partially correct |
8 ms |
1016 KB |
Wrong |
49 |
Partially correct |
10 ms |
772 KB |
Wrong |
50 |
Partially correct |
9 ms |
772 KB |
Wrong |
51 |
Partially correct |
8 ms |
908 KB |
Wrong |
52 |
Partially correct |
9 ms |
644 KB |
Wrong |
53 |
Partially correct |
8 ms |
644 KB |
Wrong |
54 |
Partially correct |
9 ms |
780 KB |
Wrong |
55 |
Partially correct |
9 ms |
772 KB |
Wrong |
56 |
Partially correct |
9 ms |
780 KB |
Wrong |
57 |
Partially correct |
11 ms |
772 KB |
Wrong |
58 |
Partially correct |
10 ms |
772 KB |
Wrong |
59 |
Partially correct |
9 ms |
780 KB |
Wrong |
60 |
Partially correct |
10 ms |
1008 KB |
Wrong |
61 |
Partially correct |
10 ms |
772 KB |
Wrong |
62 |
Partially correct |
9 ms |
880 KB |
Wrong |
63 |
Partially correct |
11 ms |
780 KB |
Wrong |
64 |
Partially correct |
10 ms |
1012 KB |
Wrong |
65 |
Partially correct |
9 ms |
784 KB |
Wrong |
66 |
Partially correct |
10 ms |
756 KB |
Wrong |
67 |
Partially correct |
10 ms |
908 KB |
Wrong |
68 |
Partially correct |
8 ms |
780 KB |
Wrong |
69 |
Partially correct |
8 ms |
644 KB |
Wrong |
70 |
Partially correct |
9 ms |
776 KB |
Wrong |
71 |
Partially correct |
11 ms |
780 KB |
Wrong |
72 |
Partially correct |
10 ms |
784 KB |
Wrong |
73 |
Partially correct |
10 ms |
908 KB |
Wrong |
74 |
Partially correct |
9 ms |
888 KB |
Wrong |
75 |
Partially correct |
9 ms |
1016 KB |
Wrong |
76 |
Partially correct |
10 ms |
772 KB |
Wrong |
77 |
Partially correct |
9 ms |
792 KB |
Wrong |
78 |
Partially correct |
10 ms |
908 KB |
Wrong |
79 |
Partially correct |
10 ms |
912 KB |
Wrong |
80 |
Partially correct |
9 ms |
888 KB |
Wrong |
81 |
Partially correct |
9 ms |
956 KB |
Wrong |
82 |
Partially correct |
10 ms |
780 KB |
Wrong |
83 |
Partially correct |
10 ms |
780 KB |
Wrong |
84 |
Partially correct |
9 ms |
932 KB |
Wrong |
85 |
Partially correct |
9 ms |
1012 KB |
Wrong |
86 |
Partially correct |
10 ms |
772 KB |
Wrong |
87 |
Partially correct |
10 ms |
644 KB |
Wrong |
88 |
Partially correct |
10 ms |
772 KB |
Wrong |
89 |
Partially correct |
9 ms |
676 KB |
Wrong |
90 |
Partially correct |
9 ms |
772 KB |
Wrong |
91 |
Partially correct |
8 ms |
772 KB |
Wrong |
92 |
Partially correct |
8 ms |
772 KB |
Wrong |
93 |
Partially correct |
8 ms |
784 KB |
Wrong |
94 |
Partially correct |
9 ms |
772 KB |
Wrong |
95 |
Partially correct |
8 ms |
644 KB |
Wrong |
96 |
Partially correct |
9 ms |
1012 KB |
Wrong |
97 |
Partially correct |
9 ms |
644 KB |
Wrong |
98 |
Partially correct |
9 ms |
644 KB |
Wrong |
99 |
Partially correct |
9 ms |
884 KB |
Wrong |
100 |
Partially correct |
10 ms |
772 KB |
Wrong |
101 |
Partially correct |
9 ms |
772 KB |
Wrong |
102 |
Partially correct |
9 ms |
644 KB |
Wrong |
103 |
Partially correct |
10 ms |
772 KB |
Wrong |
104 |
Partially correct |
8 ms |
772 KB |
Wrong |
105 |
Partially correct |
10 ms |
948 KB |
Wrong |
106 |
Partially correct |
8 ms |
644 KB |
Wrong |
107 |
Partially correct |
8 ms |
780 KB |
Wrong |
108 |
Partially correct |
8 ms |
908 KB |
Wrong |
109 |
Partially correct |
10 ms |
908 KB |
Wrong |
110 |
Partially correct |
8 ms |
776 KB |
Wrong |
111 |
Partially correct |
9 ms |
772 KB |
Wrong |
112 |
Partially correct |
9 ms |
780 KB |
Wrong |
113 |
Partially correct |
9 ms |
908 KB |
Wrong |
114 |
Partially correct |
9 ms |
772 KB |
Wrong |
115 |
Partially correct |
10 ms |
772 KB |
Wrong |
116 |
Partially correct |
9 ms |
780 KB |
Wrong |
117 |
Partially correct |
9 ms |
772 KB |
Wrong |
118 |
Partially correct |
10 ms |
644 KB |
Wrong |
119 |
Partially correct |
9 ms |
908 KB |
Wrong |
120 |
Partially correct |
9 ms |
772 KB |
Wrong |