leetcode319
public class Solution {
public int BulbSwitch(int n) {
var x = Math.Sqrt(n);
var y = Convert.ToInt32(Math.Floor(x));
return y;
}
}
https://leetcode.com/problems/bulb-switcher/#/description
leetcode319的更多相关文章
- [Swift]LeetCode319. 灯泡开关 | Bulb Switcher
There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every ...
- Leetcode319. Bulb Switcher灯泡开关
初始时有 n 个灯泡关闭. 第 1 轮,你打开所有的灯泡. 第 2 轮,每两个灯泡你关闭一次. 第 3 轮,每三个灯泡切换一次开关(如果关闭则开启,如果开启则关闭).第 i 轮,每 i 个灯泡切换一次 ...
- LeetCode 319
Bulb Switcher There are n bulbs that are initially off. You first turn on all the bulbs. Then, you t ...
随机推荐
- Mirantis OpenStack 7.0: NFVI Deployment Guide — NUMA/CPU pinning
https://www.mirantis.com/blog/mirantis-openstack-7-0-nfvi-deployment-guide-numacpu-pinning/ Compute ...
- MVC3 学习总结一(未发布)
MVC: Model,View,Control 设置View中的数据 1. 返回model,View中强类型化 Control: public ActionResult Browse(strin ...
- 请求被中止: 未能创建 SSL/TLS 安全通道,以及解决方法,即:Could not create SSL/TLS secure channel
C# 访问https请求被中止: 未能创建 SSL/TLS 安全通道(Could not create SSL/TLS secure channel) 以及 X509Certificate2 temp ...
- poj3252 数位dp
这题不是用10进制储存的,要转化成2进制再计算 dp[i][j][k] i是位数,j是1的个数,k是0的个数 #include<map> #include<set> #in ...
- BW里转换简单常用ABAP
用户查看的是当时的物料折让,那你必然要给物料加个时间,才好区分.总是以现在最新的物料状态查看历史数据会出现问题.当时这个物料是折让的,现在不折让了.数据会有问题.加个DSO.做一个时间记录.读取系统时 ...
- js动态拼接参数到请求的url上
var queryConfig={ "page" : "index", "method" : 2, //1:按照方法A查看 2:按照方法B查 ...
- nginx安装目录
1.rpm -ql nginx看看通过yum安装到哪里了 2./etc/logrotate.d/nginx 配置 nginx日志轮转 用于logrotate服务的日志切割 3./etc/ngin ...
- 《zero to one》读后感
五一放假,赶上下雨,天气很凉爽,这种天气很舒服,不冷不热,听着滴答的雨声,看看书其实也不错. 约了两个同学吃了顿饭,然后决定窝在实验室了,最近看了彼得.蒂尔的<zero to one>,确 ...
- maven module开发 自动打包
http://blog.csdn.net/u011113713/article/details/52413903 http://blog.csdn.net/sisyphus_z/article/det ...
- tableau-创建帕累托图
参考文献:https://onlinehelp.tableau.com/current/pro/desktop/zh-cn/pareto.html 帕累托图是一种按发生频率排序的特殊直方图.在质量管理 ...