chong_0428
chong_0428
全部文章
分类
归档
标签
去牛客网
登录
/
注册
chong_0428的博客
全部文章
(共128篇)
题解 | #数制转换#
def fun(a): if a < 10: return str(a) elif a >= 10: return chr(65 + a - 10) def tentoany(a, b): res = '' wh...
2024-03-19
0
163
题解 | #String Matching#
def getNext(t): next = [0] * (len(t)+1) t = list(t) i, k = 0, -1 next[0] = -1 while i < len(t): if k == -1 or t[i] == t...
2024-03-19
0
209
题解 | #Mileage Bank#
def Mileage(a, b): if b == 'F': return 2*a elif b == 'B': return int(a + 0.5*a + 0.5) elif b == 'Y' and a >= 500: ...
2024-03-18
0
215
题解 | #Skew数#
def skew(n): s = 0 i=0 while n: i += 1 t = n % 10 n = n // 10 s += t * (2**i-1) return s while True: ...
2024-03-18
0
241
题解 | #与7无关的数#
def fun(n): flag = 0 if n % 7 == 0: return 0 while n: t = n % 10 n = n / 10 if t == 7: return ...
2024-03-18
0
187
题解 | #Jungle Roads#
#include <stdio.h> #include<stdlib.h> struct Edge { int from; int to; int lenght; }; const int max = 27; struct Edge edge[ma...
2024-03-18
0
206
题解 | #大整数的因子#
def yinzi(a): f = 0 for j in a: for i in range(2, 10): if j % i == 0: f = 1 print(i,end=' ...
2024-03-11
0
160
题解 | #中位数#
def bubble(a): for i in range(len(a) - 1): for j in range(len(a) - 1 - i): if a[j] > a[j+1]: t = a[j] ...
2024-03-11
0
240
题解 | #最简真分数#
def gcd(a, b):#欧几里得算法求最大公约数 if b==0: return a else: return gcd(b, a%b) def fenshu(s): k=0 for i in range(len(s)-1): ...
2024-03-11
0
196
题解 | #Is It A Tree?#
#include<stdbool.h> #include <stdio.h> const int maxnode = 10000; int father[maxnode]; int indegree[maxnode]; bool vis[maxnode]; int heigh...
2024-03-11
0
201
首页
上一页
4
5
6
7
8
9
10
11
12
13
下一页
末页