답안 #229524

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
229524 2020-05-04T22:19:34 Z 534351 포도주 시음 (FXCUP4_wine) C++17
7 / 100
11 ms 1120 KB
#include "bartender.h"
 
std::vector<int> BlendWines(int K, std::vector<int> R){
	int N = R.size();
	for(auto &i:R){
		if(i>5) i-=4;
		else i=1;
	}
	return R;
}
#include "taster.h"
 
std::vector<int> SortWines(int K, std::vector<int> A) {
	int N = A.size();
	int sum[31] = {0, };
	for(int i=0; i<N; i++){
		if(A[i]>1) A[i]+=4;
		else{
			for(int j=i+1; j<N; j++){
				if(A[j]<=1){
					if(Compare(i, j)==1) A[i]++;
					else sum[j]++;
				}
			}
			A[i] += sum[i];
		} 
	}
	return A;
}

Compilation message

bartender.cpp: In function 'std::vector<int> BlendWines(int, std::vector<int>)':
bartender.cpp:4:6: warning: unused variable 'N' [-Wunused-variable]
  int N = R.size();
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 644 KB Correct
2 Correct 8 ms 772 KB Correct
3 Correct 10 ms 908 KB Correct
4 Correct 8 ms 644 KB Correct
5 Correct 10 ms 796 KB Correct
6 Correct 8 ms 668 KB Correct
7 Correct 10 ms 864 KB Correct
8 Correct 10 ms 780 KB Correct
9 Correct 8 ms 644 KB Correct
10 Correct 10 ms 772 KB Correct
11 Correct 11 ms 652 KB Correct
12 Correct 10 ms 644 KB Correct
13 Correct 9 ms 820 KB Correct
14 Correct 10 ms 712 KB Correct
15 Correct 11 ms 656 KB Correct
16 Correct 10 ms 824 KB Correct
17 Correct 9 ms 780 KB Correct
18 Correct 9 ms 644 KB Correct
19 Correct 10 ms 772 KB Correct
20 Correct 9 ms 900 KB Correct
21 Correct 9 ms 908 KB Correct
22 Correct 9 ms 644 KB Correct
23 Correct 11 ms 976 KB Correct
24 Correct 10 ms 644 KB Correct
25 Correct 10 ms 1060 KB Correct
26 Correct 10 ms 772 KB Correct
27 Correct 9 ms 908 KB Correct
28 Partially correct 10 ms 756 KB Wrong
29 Partially correct 9 ms 772 KB Wrong
30 Partially correct 10 ms 772 KB Wrong
31 Partially correct 9 ms 772 KB Wrong
32 Partially correct 9 ms 768 KB Wrong
33 Partially correct 9 ms 732 KB Wrong
34 Partially correct 10 ms 868 KB Wrong
35 Partially correct 11 ms 900 KB Wrong
36 Partially correct 8 ms 904 KB Wrong
37 Partially correct 10 ms 692 KB Wrong
38 Partially correct 9 ms 908 KB Wrong
39 Partially correct 8 ms 644 KB Wrong
40 Partially correct 9 ms 644 KB Wrong
41 Partially correct 9 ms 780 KB Wrong
42 Partially correct 9 ms 644 KB Wrong
43 Partially correct 10 ms 780 KB Wrong
44 Partially correct 9 ms 924 KB Wrong
45 Partially correct 10 ms 872 KB Wrong
46 Partially correct 10 ms 644 KB Wrong
47 Partially correct 10 ms 692 KB Wrong
48 Partially correct 10 ms 780 KB Wrong
49 Partially correct 9 ms 780 KB Wrong
50 Partially correct 10 ms 772 KB Wrong
51 Partially correct 9 ms 644 KB Wrong
52 Partially correct 10 ms 868 KB Wrong
53 Partially correct 10 ms 796 KB Wrong
54 Partially correct 10 ms 780 KB Wrong
55 Partially correct 10 ms 772 KB Wrong
56 Partially correct 9 ms 676 KB Wrong
57 Partially correct 10 ms 644 KB Wrong
58 Partially correct 10 ms 780 KB Wrong
59 Partially correct 8 ms 644 KB Wrong
60 Partially correct 10 ms 676 KB Wrong
61 Partially correct 9 ms 772 KB Wrong
62 Partially correct 9 ms 780 KB Wrong
63 Partially correct 8 ms 780 KB Wrong
64 Partially correct 9 ms 800 KB Wrong
65 Partially correct 9 ms 780 KB Wrong
66 Partially correct 10 ms 820 KB Wrong
67 Partially correct 9 ms 772 KB Wrong
68 Partially correct 10 ms 644 KB Wrong
69 Partially correct 9 ms 748 KB Wrong
70 Partially correct 10 ms 780 KB Wrong
71 Partially correct 9 ms 772 KB Wrong
72 Partially correct 9 ms 824 KB Wrong
73 Partially correct 9 ms 780 KB Wrong
74 Partially correct 9 ms 644 KB Wrong
75 Partially correct 10 ms 644 KB Wrong
76 Correct 9 ms 780 KB Correct
77 Correct 10 ms 772 KB Correct
78 Correct 10 ms 772 KB Correct
79 Correct 11 ms 644 KB Correct
80 Partially correct 9 ms 772 KB Wrong
81 Partially correct 10 ms 644 KB Wrong
82 Partially correct 9 ms 1120 KB Wrong
83 Partially correct 9 ms 756 KB Wrong
84 Partially correct 9 ms 780 KB Wrong
85 Partially correct 9 ms 908 KB Wrong
86 Partially correct 9 ms 644 KB Wrong
87 Partially correct 9 ms 756 KB Wrong
88 Correct 10 ms 868 KB Correct
89 Correct 8 ms 644 KB Correct
90 Correct 10 ms 732 KB Correct
91 Correct 9 ms 908 KB Correct
92 Partially correct 9 ms 644 KB Wrong
93 Partially correct 10 ms 780 KB Wrong
94 Partially correct 9 ms 644 KB Wrong
95 Partially correct 10 ms 780 KB Wrong
96 Partially correct 9 ms 772 KB Wrong
97 Partially correct 9 ms 644 KB Wrong
98 Partially correct 10 ms 980 KB Wrong
99 Partially correct 10 ms 736 KB Wrong
100 Partially correct 9 ms 908 KB Wrong
101 Partially correct 9 ms 656 KB Wrong
102 Partially correct 9 ms 684 KB Wrong
103 Correct 9 ms 820 KB Correct
104 Correct 10 ms 644 KB Correct
105 Correct 8 ms 644 KB Correct
106 Correct 9 ms 868 KB Correct
107 Partially correct 9 ms 908 KB Wrong
108 Partially correct 9 ms 780 KB Wrong
109 Partially correct 10 ms 772 KB Wrong
110 Partially correct 10 ms 772 KB Wrong
111 Partially correct 9 ms 644 KB Wrong
112 Partially correct 10 ms 644 KB Wrong
113 Partially correct 8 ms 644 KB Wrong
114 Partially correct 9 ms 644 KB Wrong
115 Partially correct 10 ms 772 KB Wrong
116 Partially correct 10 ms 780 KB Wrong
117 Partially correct 9 ms 968 KB Wrong
118 Partially correct 10 ms 908 KB Wrong
119 Partially correct 10 ms 908 KB Wrong
120 Partially correct 10 ms 908 KB Wrong