GB279824
GB279824
全部文章
分类
归档
标签
去牛客网
登录
/
注册
GB279824的博客
全部文章
(共190篇)
题解 | 无限长正整数排列字符串
s = int(input().strip()) def find_pos(s): if s <= 9: return str(s) elif s <= 189: s -= 9 index = (s-1) // 2 ...
2025-06-08
1
28
题解 | 凯撒加密
n = int(input()) s = str(input().strip()) result = [] for char in s: if 'a' <= char <= "z": new_char = chr((ord(char) - ...
2025-06-08
0
22
题解 | 斗兽棋
rules = { "elephant":"tiger", "tiger":"cat", "cat":"mouse", "mouse&qu...
2025-06-08
6
29
题解 | 年轻人不讲5的
s = list(map(str, input().strip())) for i in range(len(s)): if s[i] == '5': s[i] = '*' print("".join(s))
2025-06-07
0
27
题解 | 杨辉三角
n = int(input()) def generate_triangle(n): triangular = [] for i in range(n): # 生成n行均为1的矩阵 row = [1] * (i+1) for j in...
2025-06-07
0
31
题解 | 矩阵转置
n,m = map(int,input().strip().split()) matrix = [list(map(int,input().strip().split())) for _ in range(n)] tran_matrix = [[0]*n for _ in range(m)] ...
2025-06-07
0
36
题解 | 上三角矩阵判定
n = int(input()) matrix = [list(map(int,input().strip().split())) for _ in range(n)] def is_upper_triangular(m,matrix): for i in range(1,n): ...
2025-06-07
0
29
题解 | 单组_二维数组
import sys n,m = map(int,input().strip().split()) total = 0 for line in sys.stdin: li = list(map(int,line.strip().split(" "))) tota...
2025-06-07
0
26
题解 | 校门外的树
l,m = map(int,input().strip().split()) regin = [] for _ in range(m): a,b = map(int,input().strip().split()) regin.append((a,b)) totals = l +...
2025-06-07
0
33
题解 | 约瑟夫环
n,k,m = map(int,input().strip().split()) l = list(range(n)) while n>1: k = (k+m-1)%n l.pop(k) n -= 1 print(l[0])
2025-06-07
1
27
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页