摘要: 一道非常好的进制题 2个精华:x进制转10进制问题,二分问题 #include<bits/stdc++.h> using namespace std; typedef long long LL; LL get(string s,LL b){ LL res=0; for(auto c:s){ if(c 阅读全文
posted @ 2022-04-29 23:07 秋月桐 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1002的进阶题 #include<bits/stdc++.h> using namespace std; int k1,k2; map<float,float> m,n; int main(){ cin>>k1; int cnt=0; while(k1--){ float key,val; cin 阅读全文
posted @ 2022-04-29 23:06 秋月桐 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 简单题 #include<bits/stdc++.h> using namespace std; int n,cnt; int main(){ cin>>n; int pre=0; while(n--){ int tmp; cin>>tmp; if(tmp>pre) cnt+=(tmp-pre)*6 阅读全文
posted @ 2022-04-29 23:04 秋月桐 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 一. 单源最短路问题 Dijkstra(基于贪心) A.边权为正 储存图的数据结构:邻接表(稀疏图)或邻接矩阵(稠密图) 算法需要的基本数据结构: 1.Set 集合 (实际用bool数组代替)用于存放已求得最短路径的顶点 2.dist[] : 存放对应顶点到源点的最短路径,初始态仅源点邻居存在有值, 阅读全文
posted @ 2022-04-29 22:59 秋月桐 阅读(21) 评论(0) 推荐(0) 编辑