답안 #150766

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150766 2019-09-01T08:54:39 Z 욱방켜!! (twitch.tv/wookje)(#3584, kig9981, cheetose, jh05013) 포도주 시음 (FXCUP4_wine) C++17
0 / 100
10 ms 908 KB
#include "bartender.h"

std::vector<int> BlendWines(int K, std::vector<int> R){
	if(R.size() == 1) return R;
	for(int i=0; i<R.size(); i++)
		if(R[i] >= 2) R[i]--;
	return R;
}
#include "taster.h"

std::vector<int> SortWines(int K, std::vector<int> A) {
	if(A.size() == 1) return A;
	std::vector<int> one;
	for(int i=0; i<A.size(); i++) if(A[i] == 1) one.push_back(i);
	int a = one[0], b = one[1];
	int better = (Compare(a, b) == 1)? a : b;
	for(int i=0; i<A.size(); i++) if(i != better) A[i]++;
	return A;
}

Compilation message

bartender.cpp: In function 'std::vector<int> BlendWines(int, std::vector<int>)':
bartender.cpp:5:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<R.size(); i++)
               ~^~~~~~~~~

taster.cpp: In function 'std::vector<int> SortWines(int, std::vector<int>)':
taster.cpp:6:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<A.size(); i++) if(A[i] == 1) one.push_back(i);
               ~^~~~~~~~~
taster.cpp:9:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0; i<A.size(); i++) if(i != better) A[i]++;
               ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 908 KB Correct
2 Incorrect 8 ms 668 KB Wrong
3 Halted 0 ms 0 KB -