码迷,mamicode.com
首页 >  
搜索关键字:while read line for ifs    ( 74720个结果
每日LeetCode - 125. 验证回文串(Python 3)
Python3 双指针 class Solution: def isPalindrome(self, s: str) -> bool: n = len(s) left, right = 0, n - 1 while left < right: while left < right and not s ...
分类:编程语言   时间:2021-06-13 10:55:47    阅读次数:0
四则计算器
/*项目名称:简单的四则计算器*/// #include <stdio.h>/*是在程序编译之前要处理的内容,称为编译预处理命令。编译预处理命令还有很多,它们都以“#”开头,并且不用分号结尾,所以是c语言的程序语句。*/#include <math.h>/*意思是包含math库,实际上就是一个头文件 ...
分类:其他好文   时间:2021-06-13 10:45:51    阅读次数:0
题解 AT3875 【[ARC089A] Traveling】
不难发现,如果想要从 \((x_i,y_i)\) 走到 \((x_{i+1},y_{i+1})\),所需要的时间最少是 \(|x_{i+1}-x_i|+|y_{i+1}-y_i|\)。 同时,走的时间是 \(t_{i+1}-t_i\)。 那么初步判断,当距离大于时间,也就是说走最短路也没法按时走到, ...
分类:其他好文   时间:2021-06-13 10:17:19    阅读次数:0
2021.6.12模拟赛
题意 题解 1.一个P数如果是立方差数,不妨假设是x^3-y^3(x>y)。相当于(x-y)(x^2+xy+y^2),由于P是质数,因此x=y+1。又有(x-1)^2+x^2+x(x-1)=P,暴力枚举1~10^6判断即可。2.令dp[i][ j]表示前i个数分成j段的最少价值。枚举这个断点k,有d ...
分类:其他好文   时间:2021-06-13 10:15:33    阅读次数:0
基于 README 的文档管理
什么是 readme§ A readme (or read me) file contains information about other files in a directory or archive and is very commonly distributed with computer ...
分类:其他好文   时间:2021-06-13 09:57:10    阅读次数:0
Flink 消费RabbitMQ 和 Kafka
在消息RabbitMQ时,我们关心的一个问题是手动ack还是自动ack,如果是自动ack就怕出现丢消息的情况 Flink以RabbitMQ作为Source,是怎么保证消息唯一性的呢,是怎么保证ack的. 首先引入依赖包 <dependency> <groupId>org.apache.flink</ ...
分类:其他好文   时间:2021-06-11 19:15:45    阅读次数:0
leetcode-python-汉明距离
1)取异或,然后计算1的个数 class Solution: def hammingDistance(self, x: int, y: int) -> int: t = x^y count = 0 while t: count += 1 t = t& t-1 return count ...
分类:编程语言   时间:2021-06-11 19:07:12    阅读次数:0
python:文件操作
打开文件 with open with open(file_name,access_mode,encoding) for line in f.readlines(): print(line.strip()) #调用read()会一次性读取文件的全部内容,如果文件有10G,内存就爆了,所以,要保险起见 ...
分类:编程语言   时间:2021-06-11 18:52:26    阅读次数:0
python:yaml文件读取
yaml文件读取: def read_yaml(): with open("config.yaml", encoding='utf-8') as f: data = yaml.load(f.read(), Loader=yaml.FullLoader) print(data) ...
分类:编程语言   时间:2021-06-11 18:50:54    阅读次数:0
File "C:/秦瑞/测试项目/chk_9/dateTimeTool.py", line 19, in dtTstamp second = getpass("输入需要转换成str类型日期时间的时间戳: ") TypeError: 'module' object is not callable
getpass.getpass File "C:/秦瑞/测试项目/chk_9/dateTimeTool.py", line 19, in dtTstamp second = getpass("输入需要转换成str类型日期时间的时间戳: ")TypeError: 'module' object is ...
分类:其他好文   时间:2021-06-11 18:48:03    阅读次数:0
74720条   上一页 1 ... 14 15 16 17 18 ... 7472 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!