学习小生
学习小生
全部文章
分类
归档
标签
去牛客网
登录
/
注册
学习小生的博客
全部文章
(共22篇)
题解 | 01序列
from math import ceil m = int(input()) arr_new = "".join(input().split()).split("1") count = 0 for i in range(len(arr_new)): l...
2025-08-29
0
6
题解 | 灵异背包?
n = int(input()) arr = list(map(int,input().split())) arr_odd = [i for i in arr if i % 2 != 0] sum_max = sum(arr) if sum_max % 2 == 0: print(sum_m...
2025-08-29
0
5
题解 | 小红的字符串
s = list(input()) n = len(s) num = 0 for i in range(n // 2): if s[i] != s[n - 1 - i]: diff = abs(ord(s[i]) - ord(s[n - 1 - i])) nu...
2025-08-29
0
7
题解 | 清楚姐姐买竹鼠
a, b, x = map(int,input().split()) avg_b = b / 3 if avg_b >= a: print(a*x) else: results1 = (x // 3 + 1) * b results2 = (x // 3) * b + ...
2025-08-29
0
6
题解 | 迷宫寻路
n , m = map(int,input().split()) arr = [] for i in range(n): arr.append(list(input())) graph = {} for i in range(n): for j in range(m): ...
2025-08-28
0
9
题解 | 小红背单词
n = int(input()) arr = [input() for _ in range(n)] pas = [arr[0]] counts = {arr[0]:1} for i in arr[1:]: if i in counts: counts[i] += 1 ...
2025-08-28
0
8
题解 | 小红书推荐系统
arr = input().split() counts = {} for i in arr: if i in counts: counts[i] += 1 else: counts[i] = 1 sorted_counts = sorted(coun...
2025-08-28
0
10
题解 | 数独数组
element_count = int(input()) arr = list(map(int,input().split())) counts = set() for i in range(1,10): counts.add(arr.count(i)) if element_count &...
2025-08-28
0
8
题解 | 小红的双生串
s = input() half = int(len(s) / 2) left_s = s[:half] right_s = s[half:] max_left = 1 max_right = 1 for i in set(left_s): max_left = max(max_left,l...
2025-08-28
0
7
题解 | 预知
T = int(input()) for t in range(T): n = int(input()) arr = list(map(int,input().split())) arr1 = arr.copy() arr1.remove(max(arr1)) ...
2025-08-28
0
8
首页
上一页
1
2
3
下一页
末页