본문 바로가기

Algorithm

(177)
Aracade Intro #39 knapsackLight. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #39 knapsackLight. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. You found two items in a treasure chest! The first item weighs weight1 and is worth value1, and the second item weighs weight2 and is worth value2. What is the total maximum value of the items you can take with you, assuming that your max weight capacity is maxW and you can'..
Aracade Intro #38 growingPlant. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #38 growingPlant. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Each day a plant is growing by upSpeed meters. Each night that plant's height decreases by downSpeed meters due to the lack of sun heat. Initially, plant is 0 meters tall. We plant the seed at the beginning of a day. We want to know when the height of the plant will reach a c..
Aracade Intro #37 arrayMaxConsecutiveSum. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #37 arrayMaxConsecutiveSum. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given array of integers, find the maximal possible sum of some of its k consecutive elements. 주어진 정수에서 길이값 k 의 수만큼 연속된 길이의 내용물들의 합 최대값을 구하여라 e.g. Input -> inputArray = [2, 3, 5, 1, 6] and k = 2 Output -> arrayMaxConsecutiveSum(inputArray, k) = 8 All possible sums of..
Aracade Intro #36 differentSymbolsNaive. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #36 differentSymbolsNaive. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given a string, find the number of different characters in it. 주어진 string에서, 각자 다른 character 의 개수를 찾아봐라 e.g. Input -> s = "cabca" Output -> differentSymbolsNaive(s) = 3 There are 3 different characters a, b and c. // Process// 1. Input string s// 2. Iterate from begi..
OpenCV How to handle single channel image matrix each pixel, add/subtract/multiply/division (1), 이미지 매트릭스 각 픽셀단위 값 조정하기 (영상처리, image processing) (1) OpenCV How to handle single channel image matrix each pixel, add/subtract/multiply/division (1) 이미지 매트릭스 각 픽셀단위 값 조정하기 (영상처리, image processing) (1) Handling each pixel in matrix using put/get in OpenCV 1) / 2) both worked well, but second one did better performance. I changed to 3) using Core in OpenCV, and i'll post later. You can use any operator, but example code is about append. 1/2 둘다 동작하고,..
OpenCV Java complexNumber mat conjugation, 자바 켤레복소수 example code 예제코드 OpenCV Java complexNumber mat conjugation, 자바 켤레복소수 example code 예제코드 Description Method to conjugate complex number matrix (2c) 1 / 2 codes both work well, but 2nd one is faster than 1st one. It's only for 2channel matrix ( real(1c) + imaginary(1c) ) I'mma make new one ( 3 ) using Core for performance, and post later. Java에서 OpenCV 를 이용한 복소수 연산 중에서, 켤레복소수를 구하는 함수이다. 1 / 2 모두 동작은 잘하고 ( 1보다 2가 성능..
Aracade Intro #34 extractEachKth. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #34 extractEachKth. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given array of integers, remove each kth element from it. 주어진 정수 배열에서, e.g. Input -> inputArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and k = 3 Output -> extractEachKth(inputArray, k) = [1, 2, 4, 5, 7, 8, 10]. // Process// 1. Input vector// 2. Iterate from begin to end// 2.1. c..
Arithmetic of complex number(2) division example code, 복소수 사칙연산(2) 나눗셈 코드, real/imaginary, java, opencv, matrix (2) Arithmetic of complex number(2) division example code, 복소수 사칙연산(2) 나눗셈 코드, real/imaginary, java, opencv, matrix (2) 공식은..Formula.. i^2 = -1, c+di != 0. (a + bi) / (c + di) -> ( (ac + bd) / (c^2 + d^2) ) + ( (bc - ad) / (c^2 + d^2) ) 곱셈은 아래에Division formula is below 2018/11/22 - [Programming/Java] - Arithmetic of complex number(1) multiply example code, 복소수 사칙연산(1) 곱셈 코드, real/imaginary, java, op..