牛客459000288号
牛客459000288号
全部文章
分类
题解(9)
归档
标签
去牛客网
登录
/
注册
牛客459000288号的博客
全部文章
(共37篇)
题解 | 字符串排序
# Process input s = input() # Collect alphas alphas = [(i, x.lower()) for i, x in enumerate(s) if x.isalpha()] alphas.sort(key=lambda t: t[1]) alphas...
2026-01-06
0
7
题解 | 字符串加解密
# Process input s, t = input(), input() # Algo ord_a = ord('a') ord_A = ord('A') ord_0 = ord('0') def encode(string, offsetFunc): for ch in strin...
2026-01-06
0
11
题解 | 查找兄弟单词
# Process input chips = input().split() n = int(chips[0]) arrS = chips[1: 1+n] sx = chips[1+n] k = int(chips[2+n]) # Find siblings protoDict = {} for...
2026-01-06
0
7
题解 | 在字符串中找出连续最长的数字串
# Process input s = input() # Search listStart = [] maxLen = 0 curLen = 0 for i in range(len(s)): ch = s[i] if ch.isdigit(): curLen +...
2026-01-06
0
8
题解 | 字符串通配符
import re # Process input s, p = input(), input() # Build regex sb = [] lastCh = None for ch in s: if ch == '*': if lastCh != '*': ...
2026-01-06
0
8
题解 | 查找两个字符串a,b中的最长公共子串
# Process input s = input() t = input() if len(s) > len(t): s, t = t, s # DP arrRow_1 = [0] * (len(t) + 1) maxLen = 0 resStartT = 0 for i in r...
2026-01-06
1
8
题解 | DNA序列
# Process input s = input() n = int(input()) # Special cases if len(s) < n: exit() # Init resEnd = n - 1 cntCG = 0 for i in range(n): ch ...
2026-01-06
0
8
题解 | 小红的矩阵染色
import sys # 1 Parse and collect. iter_in = iter(sys.stdin) scores = [] n, m, k = tuple(map(int, next(iter_in).split())) arr_score = [-1] * m for lin...
2026-01-05
0
7
题解 | #字符串加密#
using System; class Program { public static void Main() { // 1 Build mapping. var table = new char[256]; var used = new b...
C#
2022-03-21
0
320
题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
using System; class Program { public static void Main() { var h0 = double.Parse(Console.ReadLine()); Console.WriteLine(h0*(1-Math...
C#
2022-03-20
0
240
首页
上一页
1
2
3
4
下一页
末页