JavaShuo
欄目
標籤
leetcode 319 29
時間 2021-01-21
原文
原文鏈接
題意:n個燈泡,第一輪全部打開;第二輪每隔2k(k=0,1,...n)個(偶數2,4,6,8.....)關閉;第三輪3k(3,6,9,12,....)個打開;... 以此類推 所以當操作爲奇數個時,燈是開的。而只有平方數的乘積個數爲奇數。可以用sqrt(n)得到有1-n中多少個完全平方數。 class Solution { public: int bulbSwitch(int n) {
>>阅读原文<<
相關文章
1.
[Leetcode 每日精選] 319. 燈泡開關
2.
[LeetCode] Distinct Subsequences [29]
3.
leetcode 29 Divide Two Integers
4.
leetcode 29. Divide Two Integers
5.
29. Divide Two Integers - LeetCode
6.
[LeetCode]29.Divide Two Integers
7.
29-Regular Expression Matching-leetcode
8.
[leetcode]29. Divide Two Integers
9.
[LeetCode] 29. Divide Two Integers
10.
LeetCode #29 Divide Two Integers
更多相關文章...
•
僞造ICMP數據包的Ethernet層
-
TCP/IP教程
•
使用netwox構造IP數據包
-
TCP/IP教程
•
爲了進字節跳動,我精選了29道Java經典算法題,帶詳細講解
•
算法總結-二分查找法
相關標籤/搜索
29%
319天
leetcode
29.python
29天
6-29
3/29
29.html5
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
跳槽面試的幾個實用小技巧,不妨看看!
2.
Mac實用技巧 |如何使用Mac系統中自帶的預覽工具將圖片變成黑白色?
3.
Mac實用技巧 |如何使用Mac系統中自帶的預覽工具將圖片變成黑白色?
4.
如何使用Mac系統中自帶的預覽工具將圖片變成黑白色?
5.
Mac OS非兼容Windows軟件運行解決方案——「以VMware & Microsoft Access爲例「
6.
封裝 pyinstaller -F -i b.ico excel.py
7.
數據庫作業三ER圖待完善
8.
nvm安裝使用低版本node.js(非命令安裝)
9.
如何快速轉換圖片格式
10.
將表格內容分條轉換爲若干文檔
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
1.
[Leetcode 每日精選] 319. 燈泡開關
2.
[LeetCode] Distinct Subsequences [29]
3.
leetcode 29 Divide Two Integers
4.
leetcode 29. Divide Two Integers
5.
29. Divide Two Integers - LeetCode
6.
[LeetCode]29.Divide Two Integers
7.
29-Regular Expression Matching-leetcode
8.
[leetcode]29. Divide Two Integers
9.
[LeetCode] 29. Divide Two Integers
10.
LeetCode #29 Divide Two Integers
>>更多相關文章<<