113-字符串替换 内存限制:64MB 时间限制:3000ms 特判: No 通过数:31 提交数:71 难度:2 题目描述: 编写一个程序实现将字符串中的所有"you"替换成"we" 输入描述: 输入包含多行数据 每行数据是一个字符串,长度不超过1000 数据以EOF结束 输出描述: 对于输入的每一行,输出替换后的字符串 样例输入: 复制 you are what you do 样例输出: we are what we do python AC: try: wh…
103-A+B Problem II 内存限制:64MB 时间限制:3000ms 特判: No 通过数:10 提交数:45 难度:3 题目描述: I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. A,B must be positive. 输入描述: The first line of the input contains an…
python未提供线程池模块,在python3上用threading和queue模块自定义简单线程池,代码如下: #用threading queue 做线程池 import queue import threading class ThreadPool(): def __init__(self,arg):#创建队列,在队列每个位置放一个threading.Tread类 self.queue_obj = queue.Queue(arg) for i in range(arg): self.queu…
4.30自我总结 一复习 1.查看数据类型 #数值10的位置 print(di(10)) #数值10的样式 print(type(10)) 2.关于变量的一些补充 a=1 b=1 c=1 #a,b,c三种位置判断 print(a is b is c) print(id(a)=id(b)=id(c)) a = 10 a is 10 ture #因为10是固定小整数池中的数据,启动python时候就固定在内存中位置不变也不会回因为引用次数为0而被删除 a = "yang" a is &qu…
Masha has recently bought a cleaner robot, it can clean a floor without anybody's assistance. Schematically Masha's room is a rectangle, consisting of w × h square cells of size 1 × 1. Each cell of the room is either empty (represented by character '…