张鹏201908190005840
张鹏201908190005840
全部文章
题解
归档
标签
去牛客网
登录
/
注册
张鹏201908190005840的博客
全部文章
/ 题解
(共24篇)
题解 | #删除字符串中出现次数最少的字符#
import sys from collections import Counter for line in sys.stdin: d=Counter(line.strip()) l=list(line.strip()) min_count=min(d.values()) ...
Python3
2022-02-20
0
390
题解 | #简单错误记录#
import sys d=dict() for line in sys.stdin: error_info=line.strip().split('\\')[-1].split(' ') file_name=error_info[0][-16:] error_line=err...
Python3
2022-02-19
0
275
题解 | #明明的随机数#
import sys c=0 cc=0 l=[] for line in sys.stdin: cc+=1 item=int(line.strip()) if c==0: c=item cc=0 else: if ite...
Python3
2022-02-19
0
332
题解 | #汽水瓶#
import sys for line in sys.stdin: p=int(line.strip()) #空瓶个数 if p==0: continue n=0 #喝汽水瓶数 while p>=2: c=p//3 ...
Python3
2022-02-17
0
300
题解 | #密码截取#
import sys for line in sys.stdin: s=line.strip() n = len(s) l = [] for i in range(0,n-1): for j in range(1,n): if...
Python3
2022-02-17
0
273
题解 | #成绩排序#
import sys items_len=0 # 记录列表长度 sort_flag=0 # 记录排序方式 items_count=0 # 计算读取有效分数个数 d=dict() # 存储有效分数和名字的字典 for line in sys.stdin: items=line.strip()....
Python3
2022-02-16
0
561
题解 | #确定字符互异#
class Different: def checkDifferent(self, iniString): # write code here from collections import Counter d=Counter(iniStrin...
Python2
2022-02-14
5
1388
题解 | #正则匹配#
for line in sys.stdin: n=float(line.strip()) last=n new=last-((last**3-n)/(3*last**2)) while abs(new-last)>0.000001:#精度要求 l...
Python3
2022-02-14
0
379
题解 | #正则匹配#
import sys from collections import Counter for line in sys.stdin: c=Counter(line.strip()) d={i:[] for i in set(c.values())} for k,v in c.items(): d[v]...
Python3
2022-02-14
0
444
题解 | #字符串旋转#
s=input().strip() p='' c=1 for i in range(len(s)): if len(s)>=2: if i+1<len(s) and s[i]==s[i+1]: c+=1 else: ...
Python3
2022-02-11
0
307
首页
上一页
1
2
3
下一页
末页