CARLJOSEPHLEE
CARLJOSEPHLEE
全部文章
分类
题解(26)
归档
标签
去牛客网
登录
/
注册
CARLJOSEPHLEE的博客
全部文章
(共216篇)
题解 | #超市里扫货#
这题我认为python选手最好要用deque来模拟,不断popleft直到deque空了就行了。 from sys import stdin from collections import deque input = stdin.readline n,v = map(int,input().spli...
Python3
pypy3
哈希表
字符串
数学
数组
2024-10-28
0
77
题解 | #小辰打比赛#
升序排序,然后遍历,遇到大于等于x就退出循环 n,x = map(int,input().split()) l = sorted([int(i) for i in input().split()]) s = 0 for i in l: if i < x: s += i ...
Python3
pypy3
数学
数组
2024-10-28
0
88
题解 | #优美字符串#
按照题意直接模拟即可,时间复杂度O(n) n = int(input()) for _ in range(n): a = input().strip() lena = len(a) s = 0 for i in range(lena-1): if a[...
Python3
pypy3
字符串
2024-10-28
0
91
题解 | #Kevin喜欢一#
设输入为n,操作次数是c,n=1时c=0,n=2时c=1…… 写出通项公式后,易得代码 from math import log2,ceil t = int(input()) for _ in range(t): print(ceil(log2(int(input()))))
Python3
数学
2024-10-28
0
84
题解 | #简单题#
考察格式化输出 from math import exp t = int(input()) for _ in range(t): a,b,c = map(int,input().split()) temp = b*exp(a) print(f"{temp:.{c}f}") ...
Python3
数学
2024-10-28
0
69
题解 | #牛牛去购物#
利用最大公倍数和最小公因数来减小枚举空间 from math import gcd n,a,b = map(int,input().split()) c = gcd(a,b) d = a*b//c l = set() for i in range(b//c): for j in range(...
Python3
数学
数组
计数
2024-10-28
0
75
首页
上一页
13
14
15
16
17
18
19
20
21
22
下一页
末页