上一页 1 2 3 4 5 6 7 8 9 10 ··· 24 下一页
摘要: 结构体自定义排序函数,调用stdlib.h库的系统快速排序qsort 1 //sjf non-preemptive with same arrival time 2 3 #include<stdio.h> 4 #include<stdlib.h> 5 #define N 5010 6 7 struc 阅读全文
posted @ 2021-05-22 21:25 墨鳌 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 这里直接是一个二分类,比较简单 本质上就是把各个事件看成独立的,概率分别计算,概率相乘求出条件概率(后验概率) 然后为了防止概率过小,取log,连乘变为连加,即求和 网页上相关的资料很多,这里就不再赘述了,直接上代码: 推荐视频: https://www.bilibili.com/video/BV1 阅读全文
posted @ 2021-05-21 12:29 墨鳌 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1 import java.io.BufferedReader; 2 import java.io.FileReader; 3 4 public class TestRead { 5 6 public static void main(String[] args) { 7 try { 8 Buffe 阅读全文
posted @ 2021-05-20 22:09 墨鳌 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 from sklearn.manifold import TSNE 3 import matplotlib.pyplot as plt 4 from mpl_toolkits.mplot3d import Axes3D 5 6 7 def read(pa 阅读全文
posted @ 2021-05-20 20:57 墨鳌 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 3 4 def update(a: int, b: int, c: int) -> tuple: 5 if a > b and a > c and a > 0: 6 return a, "↖" 7 if b > a and b > c and b > 0 阅读全文
posted @ 2021-05-20 17:18 墨鳌 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 3 4 def update(a: int, b: int, c: int) -> tuple: 5 if a > b and a > c: 6 return a, "↖" 7 if b > a and b > c: 8 return b, "↑" 9 阅读全文
posted @ 2021-05-20 17:09 墨鳌 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 3 4 def LCS(X: str, Y: str) -> tuple: 5 n, m = len(X), len(Y) 6 dp = [[0 for col in range(m + 1)] for row in range(n + 1)] 7 fl 阅读全文
posted @ 2021-05-19 14:54 墨鳌 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 1 INF = 10000 2 3 4 def getGraph() -> tuple: 5 G = [ 6 #a b c d e 7 [0, 4, 5, 0, 0], # a 8 [0, 0, 0, 8, 0], # b 9 [0, 0, 0, 0, -7], # c 10 [0, 0, 0, 0 阅读全文
posted @ 2021-05-19 14:38 墨鳌 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 1 def horsepool(S: str, P: str) -> tuple: 2 n, m, M = len(S), len(P), 26 3 shift_table = [m for _ in range(M)] 4 for i in range(m - 1): 5 shift_table[ 阅读全文
posted @ 2021-05-19 14:19 墨鳌 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 3 4 def sign(x: float) -> int: 5 if x > 0: 6 return 1 7 elif x < 0: 8 return -1 9 else: 10 return 0 11 12 13 def f(w, x, b) -> 阅读全文
posted @ 2021-05-11 16:57 墨鳌 阅读(87) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 24 下一页