전체 글
-
[HackerRank] Birthday Cake Candles c++Coding Test/HackerRank 2022. 7. 18. 11:34
Problem You are in charge of the cake for a child's birthday. You have decided the cake will have one candle for each year of their total age. They will only be able to blow out the tallest of the candles. Count how many candles are tallest. Example candles = [4,4,1,3] The maximum height candles are 4 units high. There are 2 of them, so return 2. Constraints 1
-
[Blender] 3D 블렌더 설치 방법etc 2022. 7. 18. 09:52
블렌더 프로그램을 다운받는 방법을 포스팅하겠습니다. 블렌더란? 3D 컴퓨터 그래픽 제작 프로그램입니다. 오픈소스 GPL라이선스이며 무료로 사용할 수 있습니다. 이 프로그램은 모델링, UV 언래핑, 텍스처링, 리깅, 워터 시뮬레이션, 스키닝, 애니메이팅, 렌더링, 파티클 등의 시뮬레이션을 수행할 수 있으며 넌리니어 편집, 콤포지팅, 파이썬 스크립트 등을 통하여 3D 프로그램을 제작할 수 있습니다. 리눅스, Mac OS X, 마이크로소프트 윈도우 등에서 이용할 수 있습니다 . 블렌더 공식 사이트에서 설치 파일을 다운로드 받습니다. https://www.blender.org/thanks/ Thanks — blender.org Blender is yours to keep, forever ❤ www.blender..
-
[HackerRank] Mini-Max Sum c++Coding Test/HackerRank 2022. 7. 16. 23:06
problem Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers. example arr = [1,3,5,7,9] The minimum sum is 1 + 3 + 5 + 7 = 16 and the maximum sum is 3 + 5 + 7 +9 = 24. The function prints 16 24 constraints 1
-
[HackerRank] Staircase c++Coding Test/HackerRank 2022. 7. 16. 22:31
problem This is a staircase of size n =4 : # ## ### #### Its base and height are both equal to n. It is drawn using # symbols and spaces. The last line is not preceded by any spaces. Write a program that prints a staircase of size n. sample input 6 sample output # ## ### #### ##### ###### explanation The staircase is right-aligned, composed of # symbols and spaces, and has a height and width of ..
-
[HackerRank] Plus Minus c++Coding Test/HackerRank 2022. 7. 16. 21:49
problem Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal. example arr = [1,1,0,-1,-1] There are n = 5 elements, two positive, two negative and one zero. Their ratios are 2/5 = 0.400000, 2/5 = 0.400000 and 1/5 = 0.200000. Results are printed as: 0.400000 0...
-
[HackerRank] Diagonal Difference c++Coding Test/HackerRank 2022. 7. 16. 20:58
problem Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix is shown below: 1 2 3 4 5 6 9 8 9 The left-to-right diagonal = 1 + 5 + 9. The right to left diagonal = 3 +5 +9. Their absolute difference is |15-17| = 2. sample input 3 11 2 4 4 5 6 10 8 -12 output 15 solution 왼쪽방향 대각선, 오른쪽 방향 대각선의 원소들의 합을 구한뒤 둘의 차를 구하는 문제이다. sample ..
-
[HackerRank] A Very Bing Sum c++Coding Test/HackerRank 2022. 7. 16. 20:32
Problem In this challenge, you are required to calculate and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large. Function Description Complete the aVeryBigSum function in the editor below. It must return the sum of all array elements. aVeryBigSum has the following parameter(s): - int ar[n]: an array of integers . sample input 5 1000000001 10..
-
[c++] std::accumulate 함수 vector sumProgramming/c++ 2022. 7. 16. 20:07
accumulate 함수 STL container의 원소의 합을 모두 구하고 싶을때 사용하면 유용한 함수. 1. accumulate 함수 헤더 파일 #include 2. 함수 원형 std::accumulate(const _INIT , const _INIT , int) 컨테이너의 iterator(반복자) , sum의 초기값을 Agument(인자)로 설정합니다. 3. return 값 컨테이너 원소들의 합을 모두 구한 int형으로 반환 4. 예제 #include #include #include int main() { std::vector nVec = {1,3,5,87,15}; int nSum = std::accumulate(nVec.begin(), nVec.end(), 0); std::cout