CARLJOSEPHLEE
CARLJOSEPHLEE
全部文章
题解
归档
标签
去牛客网
登录
/
注册
CARLJOSEPHLEE的博客
全部文章
/ 题解
(共16篇)
题解 | #伊甸之花#
最小值如果是1,那么肯定不能下移,最大值如果是m,那么不能上移,如果首项是1,不能下移,如果首项是m,不能上移 n,m = map(int,input().split()) l = [int(i) for i in input().split()] if n == 1: print("Yes...
Python3
pypy3
数组
数学
贪心
2024-10-29
0
43
题解 | #数位dp?#
双端队列,从前往后遍历,把前导零去掉,从后往前遍历,把末位奇数去掉。记录一下初始长度和最后长度,相减得到答案。 from collections import deque a = deque(input().strip()) oldlena = len(a) lena = len(a) while ...
Python3
pypy3
数组
数学
2024-10-29
0
43
题解 | #Raining#
数组存起来,跑一遍MAX函数即可 l = [int(i) for i in input().split()] x = int(input()) for i in l: print(max(0,x-i),end=' ')
Python3
pypy3
数组
数学
2024-10-29
0
32
题解 | #超市里扫货#
这题我认为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
55
题解 | #小辰打比赛#
升序排序,然后遍历,遇到大于等于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
53
题解 | #优美字符串#
按照题意直接模拟即可,时间复杂度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
50
首页
上一页
1
2
下一页
末页