
C、C++算法竞赛
文章平均质量分 82
不许人间见白头
时间永远静好,生活从来不易
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj 3087 Shuffle'm Up_不见不散的结局是曲终人散_新浪博客
Shuffle'm Up Time Limit:1000MS Memory Limit:65536K Total Submissions:7714 Accepted:3549 Description A common pastime for poker players at a poker table is to shuffle stacks o...原创 2015-09-05 19:44:00 · 385 阅读 · 2 评论 -
poj 1182 食物链_不见不散的结局是曲终人散_新浪博客
食物链 Time Limit:1000MS Memory Limit:10000K Total Submissions:53916 Accepted:15774 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是...原创 2015-08-21 19:09:56 · 288 阅读 · 0 评论 -
zoj 2110 Tempter of the Bone_不见不散的结局是曲终人散_新浪博客
Tempter of the Bone Time Limit:2 Seconds Memory Limit:65536 KB The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, ...原创 2015-08-20 20:13:33 · 174 阅读 · 0 评论 -
poj 1979 Red and Black_不见不散的结局是曲终人散_新浪博客
Red and Black Time Limit:1000MS Memory Limit:30000K Total Submissions:26216 Accepted:14238 Description There is a rectangular room, covered with square tiles. Each tile is co...原创 2015-08-20 19:55:11 · 321 阅读 · 0 评论 -
HDU 2181 哈密顿绕行世界问题_不见不散的结局是曲终人散_新浪博客
一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input 前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出. Output 输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出...原创 2015-08-20 19:29:28 · 248 阅读 · 0 评论 -
poj 1664 放苹果_不见不散的结局是曲终人散_新浪博客
#include int t,m,n; int fun(int m,int n) { if(m==0||n==1) return 1; if(m < n) return fun(m,m);//先将一个盘子放一个苹果; else return fun(m-n,n)+fun(m,n-1);//然后将多余的苹果在往盘子里放,...原创 2015-08-18 19:17:49 · 107 阅读 · 0 评论 -
HDU 2553 N皇后问题_不见不散的结局是曲终人散_新浪博客
思路:直接DFS; 代码如下: #include < cstdio > #include < cstring > int n,num[15],ans,cnt[15]; void df_s(int cur) { if(cur==n)//dfs通用类型; { ans++; return ; } int i,j;...原创 2015-08-08 17:18:57 · 130 阅读 · 0 评论 -
poj 1562 Oil Deposits_不见不散的结局是曲终人散_新浪博客
Time Limit:1000MS Memory Limit:10000K Total Submissions:14512 Accepted:7911 Description The GeoSurvComp geologic survey company is responsible for detecting underground oil de...原创 2015-08-08 14:44:38 · 214 阅读 · 0 评论 -
poj 2183 Bovine Math Geniuses_不见不散的结局是曲终人散_新浪博客
Time Limit:1000MS Memory Limit:65536K Total Submissions:2532 Accepted:1574 Description Farmer John loves to help the cows further their mathematical skills. He has promised th...原创 2015-08-08 14:27:11 · 158 阅读 · 0 评论 -
poj 1915 Knight Moves_不见不散的结局是曲终人散_新浪博客
Time Limit:1000MS Memory Limit:30000K Total Submissions:23303 Accepted:10928 Description Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but hi...原创 2015-08-08 11:41:07 · 268 阅读 · 0 评论 -
poj 1308 Is It A Tree?_不见不散的结局是曲终人散_新浪博客
Is It A Tree? Time Limit:1000MS Memory Limit:10000K Total Submissions:26009 Accepted:8885 Description A tree is a well-known data structure that is either empty (null, void, ...原创 2015-08-21 20:18:03 · 380 阅读 · 0 评论 -
[转载]C语言--静态变量和动态变量初始化区别_不见不散的结局是曲终人散_新浪博客
原文地址:C语言--静态变量和动态变量初始化区别作者:1234a 补充:c里等号的意义是分两种情况,一种是在表达式里, 而另一种是在变量声明中。 在变量声明中的等号不可以看作是赋值, 它只是初始化,也就是说它的意义只是告诉编译器如何初始化这个内存空间。而表达式中的 = 就是赋值的意思了。 自动变量和静态变量的初始化存在一个重要的差别。 在静态变量的初始化中,我们...原创 2015-08-22 09:32:16 · 628 阅读 · 0 评论 -
POJ 2996 Help Me with the Game_不见不散的结局是曲终人散_新浪博客
Help Me with the Game Time Limit:1000MS Memory Limit:65536K Total Submissions:3875 Accepted:2463 Description Your task is to read a picture of a chessboard position and print...原创 2015-09-05 13:51:45 · 204 阅读 · 0 评论 -
C语言中自加和自减运算符(a++、++a、a--、--a)_不见不散的结局是曲终人散_新浪博客
以自增运算符为例,当自增运算符++作用于一个变量时,例如:当i=3时++i这个算术表达式的值为4,同时变量i的值也由原来的3改变为4。一般情况下,计算表达式后不改变变量本身的值,而++运算符和--运算符组成的表达式计算后,则改变变量的值,这称为运算符的副作用。这类运算符在计算表达式时,一定要注意区分表达式的值和变量的值。 2 注意前缀运算和后缀运算的区别 仍以自增运算符为例,该运算符可作用在变...原创 2015-09-02 10:47:01 · 1529 阅读 · 0 评论 -
poj 2524 Ubiquitous Religions_不见不散的结局是曲终人散_新浪博客
Ubiquitous Religions Time Limit:5000MS Memory Limit:65536K Total Submissions:27748 Accepted:13594 Description There are so many different religions in the world today that it...原创 2015-08-27 08:23:24 · 145 阅读 · 0 评论 -
POJ 2623 Sequence Median_不见不散的结局是曲终人散_新浪博客
Sequence Median Time Limit:1000MS Memory Limit:65536K Total Submissions:16366 Accepted:4560 Description Given a sequence of N nonnegative integers. Let's define the median of...原创 2015-08-27 08:22:47 · 132 阅读 · 0 评论 -
POJ 2271 HTML_不见不散的结局是曲终人散_新浪博客
HTML Time Limit:1000MS Memory Limit:65536K Total Submissions:6548 Accepted:2162 Description If you ever tried to read a html document on a Macintosh, you know how hard it is ...原创 2015-08-26 20:48:50 · 301 阅读 · 0 评论 -
POJ 1835 宇航员_不见不散的结局是曲终人散_新浪博客
宇航员 Time Limit:2000MS Memory Limit:30000K Total Submissions:5190 Accepted:2198 Description 问题描述: 宇航员在太空中迷失了方向,在他的起始位置现在建立一个虚拟xyz坐标系,称为绝对坐标系,宇航员正面的方向为x轴正方向,头顶方向为z轴正方向,则宇航员的...原创 2015-08-26 20:01:24 · 227 阅读 · 0 评论 -
POJ 2492 A Bug's Life
A Bug's Life Time Limit:10000MS Memory Limit:65536K Total Submissions:31371 Accepted:10284 Description Background Professor Hopper is researching the sexual behavior of a ra...原创 2015-08-26 19:22:33 · 111 阅读 · 0 评论 -
POJ 1703 Find them, Catch them_不见不散的结局是曲终人散_新浪博客
Find them, Catch them Time Limit:1000MS Memory Limit:10000K Total Submissions:36652 Accepted:11242 Description The police office in Tadu City decides to say ends to the chaos...原创 2015-08-24 19:26:15 · 150 阅读 · 0 评论 -
poj 1611 The Suspects_不见不散的结局是曲终人散_新浪博客
The Suspects Time Limit:1000MS Memory Limit:20000K Total Submissions:27759 Accepted:13550 Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unkno...原创 2015-08-24 11:51:21 · 145 阅读 · 0 评论 -
poj 1950 Dessert_不见不散的结局是曲终人散_新浪博客
题意:给你一个数N(3<=N<=15);每个数之间有三种运算符“‘+’,‘-’,‘.’”。输出和值等于零的所有的运算情况及次数num,如果num大于20,则只输出前20中情况。运算符‘.’相当于连接符,例如:11.22<->1122. 思路:用dfs深搜,如果和值sum=0,则num++;注意‘.’的处理,需要用一个pre记录上一个数字,如果遇到‘.’则回溯到第一个不...原创 2015-08-08 10:06:27 · 311 阅读 · 0 评论