自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 codeforces 306 div.2 B. Preparing Olympiad

B. Preparing Olympiad time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You have n problems. You have estimated the dif

2015-07-24 00:42:39 357

原创 全排列系列

//给定元素个数n,排列序号num //返回对应的排列p #include #include #include using namespace std; int p[]={3,2,1,4}; void num2perm(int n, int *p,int num){ int i,j; //求逆序数数组 for(i=n-1;i>=0;i--)p[i]=num%(n-i),num/=n-i;

2015-07-18 16:38:45 322

转载 图论中的优先级搜索——DFS,BFS,Prim,Dijkstra

图论中的优先级搜索——DFS,BFS,Prim,Dijkstra   在图算法中经常要执行遍历每个顶点和每条边的操作,即图搜索。许多图算法都以图搜索为基础,如2-着色问题、连通性计算基于深度优先搜寻(depth-first search, DFS),而无权最短路径则基于广度优先搜索(breadth-first search, BFS)。基于搜索的算法还包括计算最小生成树的Prim算法

2015-07-12 22:22:05 3612

原创 习题6-4 骑士的移动 UVa 439

UVA - 439 Knight Moves Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description A friend of you is doing research on t

2015-07-12 20:59:11 475

原创 习题6-2 S树 UVa 712

UVA - 712 S-Trees Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit

2015-07-12 00:02:26 438

原创 Codeforces,306DIV.2A. Two Substrings

A. Two Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given string s. Your task is to determine i

2015-07-11 13:09:29 356

原创 字符串基本操作

字符串基本操作 (1)赋值:用“=”号 (2)连接:用“+”号 (3)求长度:“.size()”方法 (4)插入子串:s.insert(插入位置,”串”); (5)删除子串:s.erase(开始位置,长度); (6)查找子串:s.find(内容,开始位置),查找不到返回“string::npos”,返回的是第一个字符的位置 (7)取子串:s.substr(开始位置,长度); (8)

2015-07-11 10:42:47 307

原创 UVa 455 周期串

Periodic Strings  A character string is said to have period k if it can be formed by concatenating one or more repetitions of another string of length k. For example, the string "abcabcabcab

2015-07-07 21:51:39 474

原创 STL 几个函数的用法

#include #include #include #include #include #include using namespace std; int main() { //cout<<"Illustrating the generic unique algorithm."<<endl; const int N=11; int array1[N]={

2015-07-07 15:57:12 323

原创 Codeforces 301(div 2) C. Ice Cave

C. Ice Cave time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You play a computer game. Your character stands on some l

2015-07-04 23:03:22 367

原创 codeforces B. School Marks

B. School Marks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Vova studies programming in an elite school. V

2015-07-04 19:37:53 360

空空如也

空空如也

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

TA关注的人

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