1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std; 10 const int N=100050; 11 int n,m,vis[N... ...
分类:
其他好文 时间:
2018-08-06 16:30:20
阅读次数:
112
第一种思路: 对于四个因数:2,3,5,7;首先定义a[original]=1,m=n=x=y=1=original;然后再分别用a[m],a[n],a[x],a[y],来表示2,,3,5,7的个数再比较a[m]乘以2,a[n]乘以3,a[x]乘以5,a[y]乘以7的大小;如果小的那个是a[x],则 ...
分类:
其他好文 时间:
2018-07-26 13:12:58
阅读次数:
148
Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7 ...
分类:
其他好文 时间:
2018-07-25 11:30:56
阅读次数:
165
思路; 如果田最快大于王最快,则count++; 如果田最快小于王最慢,则用田最慢比掉王最快,count--; 如果田最快等于王最快,则比较田最慢与王最慢 如果田最慢大于王最慢则count++; 如果田最慢小于网最慢则count--; 如果田最慢等于王最慢,则有两种情况: 第一种:田的最慢等于王的最 ...
分类:
其他好文 时间:
2018-07-24 12:26:46
阅读次数:
148
#include #include #include #define K 5001 using namespace std; struct st { int l; int w; bool t; }a[K]; bool cmp(st a,st b) { if(a.l==b.l) return a.w>... ...
分类:
其他好文 时间:
2018-07-23 12:50:07
阅读次数:
138
1.记一下结构体用sort的模板。 2.注意一下贪心。 ...
分类:
其他好文 时间:
2018-07-13 01:22:03
阅读次数:
143
#include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> using namespace std; int a[100],n,m,b[100],flag; void p ...
分类:
其他好文 时间:
2018-07-09 16:27:23
阅读次数:
116
#include <iostream> #include <cstdio>#include <cmath>#include <cstring>#include <algorithm>using namespace std;int n, a[25], visit[25], side, flag = 0 ...
分类:
其他好文 时间:
2018-07-09 16:25:12
阅读次数:
121
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3746 题意:要求字符串形成两遍的循环。 3 aaa -> 已经形成循环,所以不需要添加珠子 abca -> abc为一个循环,需要添加两个珠子 abcde -> 以abcde为一个循环,需要再添加一个a ...
分类:
其他好文 时间:
2018-07-09 00:39:27
阅读次数:
148
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=3371 Connect the Cities Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
分类:
其他好文 时间:
2018-06-19 20:11:42
阅读次数:
161