Extra Long Factorials

The factorial of the integer n, written n!, is defined as:

n! = n x (n - 1) x (n - 2) x ... x 3 x 2 x 1

Calculate and print the factorial of a given integer.

For example, if n = 3, we calculate 30 x 29 x 28 x ... x 3 x 2 x 1 and get 265252859812191058636308480000000.


HEXO - 검색 엔진 최적화(SEO)

검색 엔진 최적화(SEO)

블로그 생성 후 내가 작성한 포스트가 검색에 노출되기 위해서는 검색엔진에 노출 될 수 있도록 검색 엔진 최적화 작업을 진행해 주어야 합니다.

검색 엔진 최적화(search engine optimization, SEO)는 웹 페이지 검색엔진이 자료를 수집하고 순위를 매기는 방식에 맞게 웹 페이지를 구성해서 검색 결과의 상위에 나올 수 있도록 하는 작업을 말한다. 웹 페이지와 관련된 검색어로 검색한 검색 결과 상위에 나오게 된다면 방문 트래픽이 늘어나기 때문에 효과적인 인터넷 마케팅 방법 중의 하나라고 할 수 있다. 기본적인 작업 방식은 특정한 검색어를 웹 페이지에 적절하게 배치하고 다른 웹 페이지에서 링크가 많이 연결되도록 하는 것이다. 구글 등장 이후 검색 엔진들이 콘텐츠의 신뢰도를 파악하는 기초적인 지표로 다른 웹사이트에 얼마나 인용되었나를 사용하기 때문에 타 사이트에 인용되는 횟수를 늘리는 방향으로 최적화 한다.

위키백과검색 엔진 최적화


Jumping on the Clouds(Revisited)

Aerith is playing a cloud hopping game. In this game, there are sequentially numbered clouds that can be thunderheads or cumulus clouds. Her character must jump from cloud to cloud until it reaches the start again.

To play, Aerith is given an array of clouds, c and an energy level e = 100. She starts from c[0] and uses 1 unit of energy to make a jump of size k to cloud c[(i + k) % n]. If Aerith lands on a thundercloud, c[i] = 1, her energy (e) decreases by 2 additional units. The game ends when Aerith lands back on cloud 0.

Given the values of n, k, and the configuration of the clouds as an array c, can you determine the final value of e after the game ends?

For example, give c = [0, 0, 1, 0] and k = 2, the indices of her path are 0 -> 2 -> 0. Her energy level reduces by 1 for each jump to 98. She landed on one thunderhead at an additional cost of 2 energy units. Her final energy level is 96.

Note: Recall that % refers to the modulo operation. In this case, it serves to make the route circular. If Aerith is at c[n -1] and jumps 1, she will arrive at c[0].


Climbing the Leaderboard

Alice is playing an arcade game and wants to climb to the top of the leaderboard and wants to track her ranking. The game uses Dense Ranking, so its leaderboard works like this:

  • The player with the highest score is ranked number on the leaderboard.

  • Players who have equal scores receive the same ranking number, and the next player(s) receive the immediately following ranking number.

For example, the four players on the leaderboard have high scores of 100, 90, 90, and 80. Those players will have ranks 1, 2, 2, and 3, respectively. If Alice’s scores are 70, 80 and 105, her rankings after each game are and .


Sequence Equation

Given a sequence of n integers, p(1), p(2), ..., p(n) where each element is distinct and satisfies . For each x where , find any integer y such that p(p(y)) and print the value of y on a new line.

For example, assume the sequence p = [5, 2, 1, 3, 4]. Each value of x between 1 and 5, the length of the sequence, is analyzed as follows:

  1. x = 1 p[3], p[4] = 3, so p[p[4]] = 1
  2. x = 2 p[2], p[2] = 2, so p[p[2]] = 2
  3. x = 3 p[3], p[5] = 4, so p[p[5]] = 3
  4. x = 4 p[5], p[1] = 5, so p[p[1]] = 4
  5. x = 5 p[1], p[3] = 1, so p[p[3]] = 5

The values for yare [4, 2, 5, 1, 3].


Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×