문제를 풀었습니다


Chain multiplication - 02
Following up on the problem in 55295, you found the number of multiplications needed to multiply two matrices. Now, you are giv...

3년 초과 전

문제를 풀었습니다


Cut the rod
A rod of length n can be cut in different sizes. Different price is associated with different length of cuts. length, len= [1,...

3년 초과 전

문제를 풀었습니다


Sort Non-zeros
Consider 0s in a vector creates a break-point. sort all the sub-arrays created by those break points. For example, a = [3, 4, 1...

3년 초과 전

문제를 풀었습니다


Chain multiplication - 01
Say, you are given two matrices - A (shape= 3*4) and B(shape = 4*5). If you multiply these two matrices, the resultant matrix w...

3년 초과 전

문제를 풀었습니다


Count estrangements
Recently I made a puzzle for my wife that included a cryptogram, which involves an arrangement of the letters A through Z. I use...

3년 초과 전

문제를 풀었습니다


Determine whether one vector is a subset of another
While bumbling through a pair of problems in the Number Theory group, I wrote code to determine whether a vector is a subset of ...

3년 초과 전

문제를 풀었습니다


Cyclotomic polynomial
Given a Natural number (N), return the corresponding Cyclotomic Polynomial.

3년 초과 전

문제를 풀었습니다


Parametric Array
Create a row vector, 1xN (Integer, >1), such that the mean of the vector is M (Real number) and the standard deviation of the ...

3년 초과 전

문제를 풀었습니다


List the semiprimes
A semiprime number—or a 2-almost prime—is the product of two prime numbers. The numbers and are semiprimes, but and are not....

3년 초과 전

문제를 풀었습니다


Nuemann Polynomials
Return the coefficients of nth (n>=0) Nuemann polynomial, (a sequence in 1/t) as polynomials in alpha. The expected output is a...

3년 초과 전

문제를 풀었습니다


Scorer's Function
Evaluate the Scorer's function for a given input. The expected output is Gi(x). Note - The precision will vary for test cases...

3년 초과 전

문제를 풀었습니다


B-Zuckerman Numbers
Similar to my last problem (B_Harshad Numbers), B-Zuckerman Numbers are numbers that are divisable by the product of their digit...

3년 초과 전

문제를 풀었습니다


B-Harshad Numbers
Determine (and provide as output in decimal form) all the harshad numbers base B (B-Harshad) from a given array of decimal numbe...

3년 초과 전

문제를 풀었습니다


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

3년 초과 전

문제를 풀었습니다


Consecutive Pairs of Smooth Numbers from Set of Prime Numbers
Given an input set of prime numbers (p), generate all pairs of consecutive smooth numbers (x) (see Stormer's Theorem). For exam...

3년 초과 전

문제를 풀었습니다


Trap a knight
Consider a knight on an infinite chessboard labeled with numbers spiraling outward. A knight starting on the square labeled 1 ca...

3년 초과 전

문제를 풀었습니다


Flip the parity of digits in a decimal expansion
The number 349 has the decimal expansion . If we change the even digits from positive to negative, then the number becomes 269 (...

3년 초과 전

문제를 풀었습니다


Count the peaceful queens
In a 5x5 chessboard with a queen of one color (white, say) on the perimeter, one can place 12 black queens on the board such tha...

3년 초과 전

문제를 풀었습니다


Hyperperfect Numbers
A k-hyperperfect number is a natural number n for which the equality n = 1 + k(σ(n) − n − 1) holds, where σ(n) is the divisor ...

3년 초과 전

문제를 풀었습니다


Determine whether a number is practical
A number is practical if all smaller numbers can be written as a sum of the proper divisors of . The number 24 is practical bec...

3년 초과 전

문제를 풀었습니다


List odd twin composites
Twin primes, or prime numbers that differ by 2 (e.g., 17 and 19, 59 and 61, or 191 and 193), are the subject of several Cody pro...

3년 초과 전

문제를 풀었습니다


Find the length of stream affected by a spill
When a contaminant is spilled into a stream, one might want to know how much of the stream is affected—e.g., the length over whi...

3년 초과 전

문제를 풀었습니다


Find the particular dividend
It is known that once you write the sequence 10101...101 long enough, the number will be finally divisible by any odd number if ...

3년 초과 전

문제를 풀었습니다


Count the ways to make Scorigami
Regarding the sport known as American football, some people are such rabid fans that they can tell you the statistics of every p...

3년 초과 전

문제를 풀었습니다


Solve an ODE: concentrations predicted by the cells-in-series model
One approach for predicting mixing and transport of contaminants in a river is the cells-in-series model. The model divides a ri...

3년 초과 전

문제를 풀었습니다


Local Extrema
Given a 2D (m,n>1) matrix, replace an element if it is not a local extrema (minima/maxima), with 0 (zero). The comparison crite...

3년 초과 전

문제를 풀었습니다


Spell musical triads
Chords form the basis of harmony in music. The most basic chords are triads, or groups of three notes. They are specified by thr...

3년 초과 전

문제를 풀었습니다


Leyland Primes
A Leyland Number is defined as a number of the form - x^y + y^x, or, x^y - y^x (x,y)>1 Given an array of numbers(>1), check...

3년 초과 전

문제를 풀었습니다


Compute the period of a pendulum started from a finite initial angle
Cody Problem 49830 asks for the period of a pendulum swinging through a small angle. Here the pendulum started at rest from an ...

3년 초과 전

문제를 풀었습니다


Weird Diagonal Matrix!!
Given an integer n, create a matrix whose diagonal elements will be square matrices of size 1 to n. For example: n=2 z = ...

3년 초과 전

더 보기