笔记
Mark Young
关于技术,刻意练习
展开
-
acwing 约数之和
先上一张核心算法的图#include<bits/stdc++.h>using namespace std;const int N = 50000;typedef long long ll;const int mod = 1e9+7;int st[N]; int main() { int t; cin>>t; int n; unordered_map<int,int> primes; while(t--) { cin>>n; .原创 2022-04-02 20:59:10 · 80 阅读 · 0 评论 -
蓝桥杯-路径
小蓝学习了最短路径之后特别高兴,他定义了一个特别的图,希望找到图 中的最短路径。小蓝的图由 2021 个结点组成,依次编号 1 至 2021。对于两个不同的结点 a, b,如果 a 和 b 的差的绝对值大于 21,则两个结点 之间没有边相连;如果 a 和 b 的差的绝对值小于等于 21,则两个点之间有一条 长度为 a 和 b 的最小公倍数的无向边相连。例如:结点 1 和结点 23 之间没有边相连;结点 3 和结点 24 之间有一条无 向边,长度为 24;结点 15 和结点 25 之间有一条无向边,长度原创 2022-03-01 23:53:27 · 704 阅读 · 0 评论 -
nim游戏总结
结论:#include<bits/stdc++.h>typedef long long ll;using namespace std;int x;int main(){ int n; int res = 0; scanf("%d",&n); for(int i=0;i<n;i++) { cin>>x; res^=x; } if(res==0) cout<<"NO"<<endl; else cout<原创 2022-02-12 19:07:47 · 2014 阅读 · 0 评论 -
Excel地址-第八届蓝桥省赛-C组 (60 分)
```cpp#include<bits/stdc++.h>#define N 10005using namespace std;int n;vector<int>v;int main(){ int r; scanf("%d",&n); for(int i=0;i<n,n>0;i++) { r=n%26; if(r==0) //判断 r=26; v.push_back(r);// n=(n-r)/26; } for(.原创 2022-01-07 18:15:54 · 296 阅读 · 0 评论 -
SVM初学
本章部分代码来自https://www.jb51.net/article/131580.htmfrom sklearn import svm import numpy as np import matplotlib.pyplot as plt np.random.seed(0) x = np.r_[np.random.randn(20,2)-[2,2],np.random.randn(20,2)+[2,2]] #正态分布来产生数字,20行2列*2 y = [0]*20+[1]*20 #20原创 2021-09-03 10:12:41 · 217 阅读 · 0 评论 -
KNN算法初学
import csvimport randomwith open('Prostate_Cancer.csv','r') as file: reader=csv.DictReader(file) datas=[row for row in reader] random.shuffle(datas)n=len(datas)//3test_set=datas[0:n]train_set=datas[n:]def distance(d1,d2): res=0原创 2021-08-29 10:19:33 · 50 阅读 · 0 评论