CARLJOSEPHLEE
CARLJOSEPHLEE
全部文章
分类
题解(26)
归档
标签
去牛客网
登录
/
注册
CARLJOSEPHLEE的博客
全部文章
(共71篇)
题解 | 称砝码
n = int(input()) weights = [int(i) for i in input().split()] nums = [int(i) for i in input().split()] set1 = set() set1.add(0) for i in range(n): ...
2025-03-11
0
179
题解 | 汽水瓶
while 1: n = int(input()) if n == 0: break cnt = 0 while n >= 3: cnt += n//3 n = n%3+n//3 if n == 2: ...
2025-03-11
0
159
题解 | 走方格的方案数
n,m = map(int,input().split()) n += 1 m += 1 dp = [[0]*(m+1) for _ in range(n+1)] for i in range(1,n+1): dp[i][1] = 1 for j in range(1,m+1): d...
2025-03-11
0
147
题解 | 统计字符
a = input() n = len(a) cnt1,cnt2,cnt3,cnt4=0,0,0,0 for i in range(n): temp = ord(a[i]) if 65<=temp<=90 or 97<=temp<=122: c...
2025-03-11
0
130
题解 | 统计每个月兔子的总数
n = int(input()) def f(x): a,b = 1,1 for _ in range(x): a,b = a+b,a return b print(f(n-1))
2025-03-11
0
124
题解 | 排序
n = int(input()) l = [int(i) for i in input().split()] if input() == "0": l.sort() else: l.sort(reverse=True) print(" ".jo...
2025-03-11
0
105
题解 | 小红的合数寻找
x = int(input()) print(2*x if x != 1 else -1)
2025-03-11
0
105
题解 | 小红的正整数计数
l,r = map(int,input().split()) print(r//2-(l-1)//2)
2025-03-11
0
88
题解 | 小红的正整数构造
l,r,x = map(int,input().split()) temp = x while 1: if l<=temp<=r: print(temp) break elif temp > r: print(-1) ...
2025-03-11
0
88
题解 | 彩虹糖的梦
print(min([int(i) for i in input().split()]))
2025-03-11
0
72
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页