国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Leetcode 2549. Count Distinct Numbers on Board

2023-01-29 12:06 作者:您是打尖兒還是住店呢  | 我要投稿

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.

?

Example 1:

Input: n = 5Output: 4Explanation: Initially, 5 is present on the board. The next day, 2 and 4 will be added since 5 % 2 == 1 and 5 % 4 == 1. After that day, 3 will be added to the board because 4 % 3 == 1. At the end of a billion days, the distinct numbers on the board will be 2, 3, 4, and 5.

Example 2:

Input: n = 3Output: 2Explanation: Since 3 % 2 == 1, 2 will be added to the board. After a billion days, the only two distinct numbers on the board are 2 and 3.



Runtime:?0 ms, faster than?100.00%?of?Java?online submissions for?Count Distinct Numbers on Board.

Memory Usage:?38.9 MB, less than?85.71%?of?Java?online submissions for?Count Distinct Numbers on Board.


Leetcode 2549. Count Distinct Numbers on Board的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
甘德县| 浦县| 抚远县| 宜君县| 克什克腾旗| 抚远县| 杭锦旗| 囊谦县| 辽源市| 黄梅县| 金堂县| 全州县| 鄱阳县| 蛟河市| 墨玉县| 安龙县| 江永县| 洞口县| 阜宁县| 普兰店市| 措勤县| 天等县| 鄯善县| 中江县| 建湖县| 曲阳县| 独山县| 泰宁县| 临洮县| 汕头市| 衡水市| 南宁市| 扎兰屯市| 新竹市| 上蔡县| 武乡县| 梁平县| 鹿泉市| 云龙县| 锡林郭勒盟| 林州市|