自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 问答 (2)
  • 收藏
  • 关注

转载 快速幂模板

快速幂模板(整数+矩阵) 1//整数的快速幂 m^n  % k 的快速幂:  long long  quickpow(long long   m , long long   n , long long   k){      long long   ans = 1;      while(n){          if(n&1)//如果n是奇数              ans = (a

2014-08-06 15:54:10 448

原创 poj3280

题目的意思是给定一个字符串,让你用最

2014-08-01 14:15:48 564

转载 最短路学习(转)

1 最短路径问题(The shortest-path problem, SPP)     最短路径问题是图论研究中的一个经典算法问题,旨在寻找图中两结点之间的最短路径。 算法具体的形式包括: 1) 确定起点的最短路径问题 - 即已知起始结点,求最短路径的问题。 2) 确定终点的最短路径问题 - 与确定起点的问题相反,该问题是已知终结点,求最短路径的问题。在无向图中该问题与确定起点的问题完全等

2014-07-22 15:07:31 535

原创 POJ3187

全排列的使用 #include #include #include #include using namespace std;  int a[20],b[20][20]; int main() {   int i,j,m,n,sum,sum1;   while(scanf("%d%d",&m,&n)!=EOF)   {       sum=1;       mem

2014-07-17 15:01:46 474

原创 优先队列对于1种类型的使用例子

#include #include #include #include using namespace std;  priority_queue, greater > q;  int a[20005]; int main() {   int i,j,m,n,sum1;   long long sum;   while(scanf("%d",&m)!=EOF)   {

2014-07-17 09:54:24 388

原创 通过一道贪心学到了优先队列的用法

题目是POJ3190 #include #include #include #include using namespace std; struct dd { int l; int r; int ps; friend bool operatorstruct dd k1,struct dd k2) { return k1.r>k2.r

2014-07-16 16:38:37 388

原创 贪心

#include #include #include #include #include using namespace std; struct time {     int x;     int y; } a[25001]; int cmp(time a,time b) {     return a.x } int main() {     int i,n,T;

2014-07-10 13:40:26 361

原创 2进制数

#include #include int main() {   int a,i,j,m,len,t;   int b[500];   int *pstart,*pend;   printf("0\n");   for(i=1;i   {        m=0;        a=0;        t=i;      for(j=i;j>0;j=j/2)      {

2014-06-10 13:08:51 512

原创 利用字符串指针编写以程序求所有不超过200的N值,N的平方是具有对称性的回文数

#include #include int m,n,i,j,a[200]; char str[1000]; int main() {     int j=0;   for(i=0;i   {       int k=0;     m=i*i;    itoa(m, str, 10);    char *p,*q;    p=str;    q=p;    while

2014-06-03 07:42:33 3359

原创 考试专用

2。#include #include #include using namespace std; bool cmp(int a,int b) {    return a } int main() {   int a[100],b[100];   int m,n,i,j,k;   while(scanf("%d",&m)!=EOF)   {       n=m;  

2014-05-25 23:04:22 463

转载 函数作用(持续积累)

next_permutation( #include #include #include #include #include #include #include #include using namespace std; int a[6][6]; int main() {     for(int i=0;i         for(int j=0;j      

2014-05-22 23:08:58 418

原创 指针和函数的一些格式(自用)

#include #include char *shift(char *pstr,int n,char mode); int main() {    int i,j,n,o;    char pstr[1000];    char mode;    printf("请输入字符串:");    scanf("%s",pstr);    printf("请输入移动位数:");

2014-05-21 22:47:10 505

原创 C - Sereja and Suffixes

在11组数据上跪了好多次。。。 Description Sereja has an array a, consisting of n integers a1, a2, ..., an. The boy cannot sit and do nothing, he decided to study an array. Sereja took a piece of paper

2014-05-18 22:22:24 432

原创 记忆力不好

bool cmp(int a,int b) {    return a>b; } #include #include #include using namespace std; struct dd {     double d;     int p; }a[1005]; typedef struct dd dd; bool cmp(dd q,dd b) {

2014-05-18 01:01:01 588

原创 杭电acm2041 超级楼梯

Description 有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法?   Input 输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1   Output 对于每个测试实例,请输出不同走法的数量   Sample Input 2

2014-04-24 11:16:32 452

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除