[LeetCode] Count Distinct Numbers on Board

2549. Count Distinct Numbers on Board

You are given a positive integer n, that is initially placed on a board. Every day, for 109 days, you perform the following procedure:

  • For each number x present on the board, find all numbers 1 <= i <= n such that x % i == 1.
  • Then, place those numbers on the board.

Return the number of distinct integers present on the board after 109 days have elapsed.

Note:

  • Once a number is placed on the board, it will remain on it until the end.
  • % stands for the modulo operation. For example, 14 % 3 is 2.
Read more
[AtCoder] C - 高橋王国の分割統治Read more
[AtCoder] D - 閉路Read more
[AtCoder] D - 壊れた電卓Read more
[AtCoder] C - 高橋君と国家Read more
[AtCoder] D - 映画の連続視聴Read more
[Codeforces] Round #695 (Div. 2) B. Hills And ValleysRead more
[Codeforces] 2020-2021 ICPC, NERC, Southern and Volga Russian Regional Contest (Online Mirror, ICPC Rules) D. FirecrackersRead more
[Codeforces] 2020-2021 ICPC, NERC, Southern and Volga Russian Regional Contest (Online Mirror, ICPC Rules) F. Full TurnRead more
[Codeforces] Educational Round 101 (Rated for Div. 2) D. Ceil DivisionsRead more