CARLJOSEPHLEE
CARLJOSEPHLEE
全部文章
分类
题解(26)
归档
标签
去牛客网
登录
/
注册
CARLJOSEPHLEE的博客
全部文章
(共216篇)
题解 | 排序
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
149
题解 | 小红的合数寻找
x = int(input()) print(2*x if x != 1 else -1)
2025-03-11
0
151
题解 | 小红的正整数计数
l,r = map(int,input().split()) print(r//2-(l-1)//2)
2025-03-11
0
141
题解 | 小红的正整数构造
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
123
题解 | 彩虹糖的梦
print(min([int(i) for i in input().split()]))
2025-03-11
0
116
题解 | 构造A+B
x,y = map(int,input().split()) print("YES" if x-y>=1 else "NO")
2025-03-11
0
97
题解 | 自守数
l = [1, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5...
2025-03-11
0
80
题解 | 小红的二叉树
n = int(input()) if n == 1: print(0) else: pow1 = pow(2,n-1,1000000007) print((3*pow1-5)%1000000007)
2025-03-10
1
118
题解 | 公共子串计算
a = input() b = input() na,nb = len(a),len(b) dp = [[0]*(nb+1) for _ in range(na+1)] for i in range(1,na+1): for j in range(1,nb+1): if a[...
2025-03-06
0
55
题解 | 统计大写字母个数
a = input() cnt = 0 for i in a: if i.isupper(): cnt += 1 print(cnt)
2025-03-05
0
69
首页
上一页
11
12
13
14
15
16
17
18
19
20
下一页
末页