본문 바로가기

Programming

(102)
Project Euler #11 : Largest product in a grid(Brute Force) This problem is actually hard to find efficient algorithms.  Difficulty rating is 5%.I tried to solve it using the greed algorithm, but the greed algorithm doesn't always give the best results, but it's hard to expect a speedup because of the sorting time.Because sorting 400 data itself is basically more asymptotic than it is to compute all the products sequentially. I thought there was nothing ..
BOJ #1007 Vector Matching(Mathematics) This is a Gold II problem. At first, I thought that it was a TSP program using dynamic programming, and I worked hard. It was a Gold I problem when I solved the problem, but the difficulty rating has been reduced. Somehow vector matching is the problem name, but it wasn't a TSP problem. And if it was a TSP problem, it would have been given a more difficult rating. If it was a TSP problem, you wo..
BOJ #1005 ACM Craft There are many kinds of algorithms related to graph theory, and there are various solutions to solve one problem. Algorithms consisting of prim, Dijkstra, and A * are the same, but the only difference is to find and update adjacent nodes. Floyd Warshal, Krscal, and so on. This topology sort algorithm is simple enough to memorize it. This problem difficulty ranked Gold II (about top 60% solver ca..
[C/C++] BOJ #1003 Fibonacci This problem was solved six months ago while solving the problems of Paekjoon Online Judgement Algorithm site. Fibonacci functions have a very simple structure, which is often mentioned as various properties are discovered. When learning the C/C ++ language, it is often discussed with the Tower of Hanoi to learn the concept of recursive functions.This question is not a high percentage of correct..
BOJ #1002 Turret. It seems that this problem was first solved after joining the Baekjun algorithm. An intellectual asked a question of the Baekjun algorithm, and I remember joining the Baekjun algorithm to answer it, and then solved some problems. At that time, I was attending Yonsei University, so I registered as Yonsei University, but it is already a few years ago. Since I had been used to the Euler project for..
515. Project Euler #515 : Dissonant Numbers Original Problem : Let d(p,n,0) be the multiplicative inverse of n modulo prime p, defined as n × d(p,n,0) = 1 mod p. Let for k ≥ 1.Let for all primes a ≤ p = 0 ) { int64_t r = t; t = -t*rec[count]+s; s = r; } t = (t>0)?t:p+t; return t; } Nevertheless all optimization algorithms are applied to my second algorithm, It's hard to solve this problem. I guessed consuming time is 10,000 minutes which ..
508. Project Euler #508 : integers in base i-1 This problem's solvers are under 100. This is very hard problem, so I can't describe detail solving method in this blog. This problem is. Consider the Gaussian integer i-1. A base i-1 representation of a Gaussian integer a+bi is a finite sequence of digits dn-1dn-2...d1d0 such that:a+bi = dn-1(i-1)n-1 + dn-2(i-1)n-2 + ... + d1(i-1) + d0Each dk is in {0,1}There are no leading zeroes, i.e. dn-1 ≠ ..
510. Project Euler #510 : Tangent circles. This is a recent problem, so not now, difficulty rating is not determined. I think difficulty rating is about 50%. At my middle school hood, math teacher said that geometry problem can be solved if you draw lines properly. This problem is sam. This picture is that added lines and triangles on original problem image. Make repairs to the line L in circle A, make repairs to the line L in circle B, ..
10. Project Euler #10 : Sum of primes Difficulty rating is 5%.  The task is to calculate all prime numbers below 2 million.The solution is straightforward: use the Sieve of Eratosthenes to find primes below 2 million.There are several algorithms to check if a number is prime, such as Miller-Rabin and AKS. However, for this problem, I believe the Sieve of Eratosthenes is the best approach. #include #include int main(){ int primes[..
9, Project Euler #9 : Special Pythagorean triplet Difficulty rating is 5%. A Pythagorean triplet is a set of three natural numbers, a

반응형