chong_0428
chong_0428
全部文章
分类
归档
标签
去牛客网
登录
/
注册
chong_0428的博客
全部文章
(共63篇)
题解 | #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
185
题解 | #大整数的因子#
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
152
题解 | #中位数#
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
213
题解 | #最简真分数#
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
182
题解 | #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
191
题解 | #采药#
def best(sum, time, value, n): dp = [0]*(sum+1) dp[0]=0 for i in range(0, n): for j in range(sum, time[i]-1, -1): dp[j...
2024-03-10
0
166
题解 | #点菜问题#
def best(c, p, v, n): dp = [0]*(c+1) dp[0] = 0 for i in range(0, n): for j in range(c, p[i]-1, -1): dp[j] = max(dp[j],...
2024-03-10
0
167
题解 | #放苹果#
def apple(m, n): dp = [[0 for i in range(n+1)] for j in range(m+1)] for i in range(1, m+1): dp[i][1] = 1 for j in range(1, n+1...
2024-03-09
0
170
题解 | #密码翻译#
def coding(s): s = list(s) for i in range(len(s)): if ord(s[i]) >= ord('a') and ord(s[i]) <= ord('y') or ord(s[i]) >= ord('A'...
2024-03-09
0
201
题解 | #日志排序#
datas = [] while True: try: line = input().strip() if not line: break datas.append(line) except EOFError: ...
2024-03-07
0
205
首页
上一页
1
2
3
4
5
6
7
下一页
末页