上一页 1 2 3 4 5 6 7 8 9 ··· 24 下一页
摘要: 有向图找环 1 #include<cstdio> 2 #include<cstring> 3 int map[27][27],indegree[27],q[27]; 4 int TopoSort(int n){ 5 int t=0,temp[27],p,m,flag=1; //flag=1:有序 f 阅读全文
posted @ 2021-07-01 22:32 墨鳌 阅读(34) 评论(0) 推荐(0)
摘要: 题目大意: 有电器和配套的插座,以及每种无限个的装换插头 问:最少多少电器用不上电? 画画图,可以知道是一个二分图,中间结点需要用传递闭包优化掉 Floyd+匈牙利算法(二分图匹配) 1 #include<map> 2 #include<cmath> 3 #include<queue> 4 #inc 阅读全文
posted @ 2021-07-01 22:05 墨鳌 阅读(48) 评论(0) 推荐(0)
摘要: 点权拆出来与0号点连边,按照下属→上级的方向建立有向图,跑一个s=0,t=1的单源最短路 限制条件:搜索到的最短路径中,阶级差不超过m 1 #include <queue> 2 #include <vector> 3 #include <cstring> 4 #include <iostream> 阅读全文
posted @ 2021-07-01 17:23 墨鳌 阅读(38) 评论(0) 推荐(0)
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 long long n,x,t,m,k; 4 int main(){ 5 cin>>k; 6 while(k--){ 7 cin>>n>>x>>t; 8 m=min(t/x,n); 9 cout< 阅读全文
posted @ 2021-06-30 16:05 墨鳌 阅读(34) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 3 /*structure declaration*/ 4 struct employee{ 5 char *name; 6 int employee_id; 7 double salary; 8 }; 9 10 struct employee make 阅读全文
posted @ 2021-06-07 16:32 墨鳌 阅读(77) 评论(0) 推荐(0)
摘要: 1 import java.util.Iterator; 2 import java.util.NoSuchElementException; 3 4 public class ArrayList<E> implements Iterable<E> { 5 private final int INI 阅读全文
posted @ 2021-06-03 20:18 墨鳌 阅读(70) 评论(0) 推荐(0)
摘要: 利用高斯函数,使得较近的数据点决策作用更大! 代码也比较简洁!Accuracy=0.9466666666666667 注意一下: 其实h=1的选取相当于你的先验知识;或者说多尝试几次 让电脑自己试错,有时候其实方法直接的界定其实没有那么严格啦 1 import numpy as np 2 from 阅读全文
posted @ 2021-05-28 18:08 墨鳌 阅读(264) 评论(0) 推荐(0)
摘要: 借鉴了老师的代码,但是没有封装 效果还是挺好的 average accuracy>90% 1 from random import shuffle 2 import numpy as np 3 from collections import Counter 4 5 6 def read(path: 阅读全文
posted @ 2021-05-28 15:07 墨鳌 阅读(163) 评论(0) 推荐(0)
摘要: [K-means Algorithm][3D子图] 由于K-means Algorithm是基于随机点选取的, 所以可能结果较差,甚至RE ! ! ! 1 import numpy as np 2 import random 3 import matplotlib.pyplot as plt 4 f 阅读全文
posted @ 2021-05-27 18:25 墨鳌 阅读(125) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2021-05-22 23:59 墨鳌 阅读(3) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 24 下一页