2018年7月24日

摘要: 迭代器用法map m; //第一个为键,第二个为值 for(int i=10;i>=0;i--) // 这里是按从大到小的顺序,但是迭代器是按从小到大的顺序输出 if(i%2==0) //因为map自带按键从小到大... 阅读全文
posted @ 2018-07-24 11:48 ~~晨阳 阅读(930) 评论(0) 推荐(0) 编辑

2018年7月23日

摘要: #include #include #include int main(){ int n,i,k; srand(time(NULL)); n=rand()%101; for(i=1;in) ... 阅读全文
posted @ 2018-07-23 20:40 ~~晨阳 阅读(425) 评论(0) 推荐(0) 编辑
 
摘要: LIS 最长上升子序列 #include #include using namespace std;int a[1001],ans[1001],len;int main(){ int n,T; cin>>T; while(T--) { ... 阅读全文
posted @ 2018-07-23 17:30 ~~晨阳 阅读(131) 评论(0) 推荐(0) 编辑
 
摘要: bool cmp(int a,int b){ return a<b;}int main(){ int a[10]={2,7,1,4,4,6}; sort(a,a+6,cmp); // 去重之前先排序 int m=unique(a,... 阅读全文
posted @ 2018-07-23 17:15 ~~晨阳 阅读(116) 评论(0) 推荐(0) 编辑
 
摘要: import java.io.*;import java.util.*;import java.math.*;import java.text.*;public class Main { public static void main(String args[]) ... 阅读全文
posted @ 2018-07-23 11:44 ~~晨阳 阅读(141) 评论(0) 推荐(0) 编辑

2018年7月21日

摘要: snow 是个热爱打字的家伙,每次敲出更快的速度都会让他很开心。现在,他拿到一篇新的打字文章,已知这篇文章只有 26 个小写英文字母,给出 snow 打出这 26 个英文字母分别需要多少时间 (s),问 snow 打完这篇文章获得的 kpm(打正确的字数/所花的分钟数... 阅读全文
posted @ 2018-07-21 20:43 ~~晨阳 阅读(109) 评论(0) 推荐(0) 编辑
 
摘要: 对四种最短路算法的总结 博客来源:转自 https://blog.csdn.net/JKdd123456/article/details/80615322大佬博客 迪杰斯特拉算法最短路的四种算法总结师哥博客(代码来源)最短路径问题介绍问题解释:从图中的某个顶点出发到达... 阅读全文
posted @ 2018-07-21 08:40 ~~晨阳 阅读(212) 评论(0) 推荐(0) 编辑

2018年7月20日

摘要: n的阶乘后面有多少个0?6的阶乘 = 1*2*3*4*5*6 = 720,720后面有1个0。Input一个数N(1 int main(){ int n,a,sum=0; scanf("%d",&n); while(n>=5) { ... 阅读全文
posted @ 2018-07-20 17:08 ~~晨阳 阅读(185) 评论(0) 推荐(0) 编辑
 
摘要: 给出2个大整数A,B,计算A+B的结果。Input第1行:大数A第2行:大数B(A,B的长度 #include #include#include#include using namespace std;typedef long long LL;int main(){ ... 阅读全文
posted @ 2018-07-20 16:46 ~~晨阳 阅读(198) 评论(0) 推荐(0) 编辑
 
摘要: 中国剩余定理详解见博客:https://www.cnblogs.com/linyujun/p/5199415.html BiorhythmsSome people believe... 阅读全文
posted @ 2018-07-20 16:07 ~~晨阳 阅读(139) 评论(0) 推荐(0) 编辑