上一页 1 ··· 4 5 6 7 8 9 10 下一页

2012年8月8日

<Codeforces Round #127 (Div. 1)> B. Guess That Car!(难题)

摘要: B. Guess That Car!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA widely known among some people Belarusian sport programmer Yura possesses lots of information about cars. That is why he has been invited to participate in a game show called &qu 阅读全文

posted @ 2012-08-08 22:52 铁树银花 阅读(283) 评论(0) 推荐(0) 编辑

<Codeforces Beta Round #38> D. Vasya the Architect

摘要: Vasya the Architecttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce Vasya played bricks. All the bricks in the set had regular cubical shape. Vasya vas a talented architect, however the tower he built kept falling apart.Let us consider the bu 阅读全文

posted @ 2012-08-08 18:05 铁树银花 阅读(237) 评论(0) 推荐(0) 编辑

[置顶] C++/C 数据类型的取值范围

摘要: 运行以下程序#include <iostream> #include <limits> using namespace std; int main() { //long long 的范围: cout << numeric_limits<long long int>::min() << " ~ " << numeric_limits<long long int>::max() << endl; //int 的范围 cout << numeric_limits<in 阅读全文

posted @ 2012-08-08 09:44 铁树银花 阅读(208) 评论(0) 推荐(0) 编辑

Funny Funny Game(数学题)

摘要: Funny Funny GameTime Limit:1000MSMemory Limit:131072KB64bit IO Format:%lld & %lluSubmitStatusPracticeHUST 1427DescriptionSuper Hanhan(SH) loves playing all kinds of little games very much. Today rocket323 recommends a new game to SH.The game’s name is “Eating stones”, and it’s played like this: 阅读全文

posted @ 2012-08-08 00:12 铁树银花 阅读(309) 评论(0) 推荐(0) 编辑

2012年8月7日

Shot(数学+物理题,不简单)

摘要: ShotTime Limit:1000MSMemory Limit:65535KB64bit IO Format:%lld & %lluSubmitStatusPracticeUESTC 1014Description“超人”霍华德在NBA扣篮大赛上要求把篮筐升高表演扣篮,但是却没有得到批准,现在我们的hhb也想要给大家表演一个,但是这次他想要表演的是投篮,篮筐放得越高,hhb的表演当然就越精彩,所以现在请你帮助hhb计算出篮筐离地最高能放多高。假设把球投到篮框的高度就算球进。忽略球和框的大小。Input多组测试数据每组测试数据包括3个浮点数h, l, v (1<=h<=2 阅读全文

posted @ 2012-08-07 22:32 铁树银花 阅读(320) 评论(0) 推荐(0) 编辑

2012年8月6日

Palindromic Numbers (III)(回文数,较麻烦)

摘要: Palindromic Numbers (III)Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusPracticeLightOJ 1396DescriptionVinci is a little boy and is very creative. One day his teacher asked him to write all the Palindromic numbers from 1 to 1000. He became very frustrated because the 阅读全文

posted @ 2012-08-06 10:13 铁树银花 阅读(277) 评论(0) 推荐(0) 编辑

2012年8月5日

<cf>Blinds

摘要: BlindsTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 38CDescriptionThe blinds are known to consist of opaque horizontal stripes that can be rotated thus regulating the amount of light flowing in the room. There arenblind stripes with the width o 阅读全文

posted @ 2012-08-05 09:39 铁树银花 阅读(335) 评论(0) 推荐(0) 编辑

2012年8月4日

Ekka Dokka(水题)

摘要: Ekka DokkaTime Limit:2000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusDescriptionEkka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggested that Ekka is very fond o... 阅读全文

posted @ 2012-08-04 21:57 铁树银花 阅读(267) 评论(0) 推荐(0) 编辑

Game of Life

摘要: Game of LifeTime Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusPracticeUVALive 4034DescriptionLIFE is a evolutionary game played on a 2D game board. Initially, the game board is filled with white and black stones. For each iteration of the game, each stone is checked and per 阅读全文

posted @ 2012-08-04 20:32 铁树银花 阅读(1131) 评论(0) 推荐(0) 编辑

Miss Kitty and Her Little Ice Cream Shop(水题)

摘要: Miss Kitty and Her Little Ice Cream ShopTime Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusPracticeUVALive 4033DescriptionMiss Kitty graduated from University N that has a long history of training their students to become teachers in an island country T. All of her classmate 阅读全文

posted @ 2012-08-04 17:06 铁树银花 阅读(245) 评论(0) 推荐(0) 编辑

数字转化为字符串,sprintf使用(弱菜笔记)

摘要: 注明:以下例程均在code::bolcks(编译器GNU GCC)下运行通过,如果读者不能正确运行,请尝试调整编译器为GNU或GCC。我们通过几个例子认识sprintf的用法,由此也初窥数字转化为字符串中数据的门径。最简单直接的方法:一个数字加上0的ASC2码就得到对应字符的ASC2码。//Example #1 #include <stdio.h> int main() { int a[3]={0, 1, 2}; char s[4]; for(int i = 0; i<3; i++) s[i] = a[i] + '0'; s[3] = '\0' 阅读全文

posted @ 2012-08-04 12:04 铁树银花 阅读(1580) 评论(0) 推荐(0) 编辑

2012年8月3日

Setu(水题)

摘要: K -SetuTime Limit:2000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusPracticeLightOJ 1387DescriptionRahaduzzaman Setu, (Roll - 12) of 13th batch, CSE, University of Dhaka. He passed away on 18thApril 2012. This is one of the saddest news to all. May he rest in peace. This problem i 阅读全文

posted @ 2012-08-03 21:06 铁树银花 阅读(979) 评论(0) 推荐(0) 编辑

<LightOJ 1338> Hidden Secret!

摘要: Hidden Secret!Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusPracticeLightOJ 1338DescriptionIn this problem you are given two names, you have to find whether one name is hidden into another. The restrictions are:1.You can change some uppercase letters to lower case a 阅读全文

posted @ 2012-08-03 20:26 铁树银花 阅读(269) 评论(0) 推荐(0) 编辑

<FZU1033>URLs

摘要: URLsTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeFZU 1033DescriptionIn the early nineties, the World Wide Web (WWW) was invented. Nowadays, most people think that the WWW simply consists of all the pretty (or not so pretty) HTML-pages that you can read wi 阅读全文

posted @ 2012-08-03 18:11 铁树银花 阅读(329) 评论(0) 推荐(0) 编辑

<FZU 1019>猫捉老鼠

摘要: A -猫捉老鼠Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeFZU 1019Description一只猫和一只老鼠在10*10的迷宫中。迷宫中的每个方格可以是空的,或者含有障碍。猫和老鼠可以进入任意一个空的方格中。当他们相遇时,猫和老鼠在同一个方格中。但是,无论猫或老鼠都不能进入有障碍的方格。我们可以用字符组成的二维数组表示迷宫,如下图所示。老鼠在迷宫中按照一种固定的方式行走:每个时刻,老鼠都向它所面对的方向前进一格,这需要花费1秒时间。如果前方是一个障碍或者是 阅读全文

posted @ 2012-08-03 11:11 铁树银花 阅读(440) 评论(0) 推荐(0) 编辑

2012年8月2日

[置顶] 最长公共子序列求解

摘要: 原文地址:http://blog.csdn.net/yysdsyl/article/details/4226630写得很好,故转载存档。提示:阅读此文前,务必先明确最长公共子序列不一定是原父串的一个连续子序列,子序列不要求连续,就如数列的子列一样.我对原文做了适当的修改,使得文章更明了易懂,如有不当欢迎指正。正文:动态规划法经常会遇到复杂问题不能简单地分解成几个子问题,而会分解出一系列的子问题。简单地采用把大问题分解成子问题,并综合子问题的解导出大问题的解的方法,问题求解耗时会按问题规模呈幂级数增加。为了节约重复求相同子问题的时间,引入一个数组,不管它们是否对最终解有用,把所有子问题的解存于该 阅读全文

posted @ 2012-08-02 10:13 铁树银花 阅读(305) 评论(0) 推荐(0) 编辑

<poj1040>Transportation

摘要: TransportationTime Limit:1000MSMemory Limit:10000KTotal Submissions:3090Accepted:1283DescriptionRuratania is just entering capitalism and is establishing new enterprising activities in many fields in- cluding transport. The transportation company TransRuratania is starting a new express train from c 阅读全文

posted @ 2012-08-02 00:09 铁树银花 阅读(447) 评论(0) 推荐(0) 编辑

2012年8月1日

<cf>System of Equations(水题)

摘要: System of Equationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFurik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark for math. For that Ms. Ivanova, his math teacher, gave him 阅读全文

posted @ 2012-08-01 11:44 铁树银花 阅读(405) 评论(0) 推荐(0) 编辑

<cf>Schedule

摘要: Scheduletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAt the beginning of the new semester there is new schedule in the Berland State University. According to this schedule,ngroups have lessons at the room 31. For each group the starting time o 阅读全文

posted @ 2012-08-01 10:34 铁树银花 阅读(381) 评论(0) 推荐(0) 编辑

2012年7月31日

一些排序方法的总结

摘要: 1.sort头文件:algorithm(1)有数组a[n],通过sort(a,a+n),可以将数列从a[0]到a[n-1]排序;通过sort(a+1,a+n-1)可以将数列由a[1]到a[n-2]排序。默认是从小到大排序。(2)如果希望从大到小排序或者按照其他规则排序可以设置比较函数。排序对象:struct Group { int s,e,idx; }a[5001];比较函数:bool cmp(Group x, Group y) { if(x.e!=y.e) return x.e<y.e;//从小到大排序 else if(x.s!=y.s) return x.s<y.s... 阅读全文

posted @ 2012-07-31 21:24 铁树银花 阅读(373) 评论(0) 推荐(0) 编辑

<cf>Sysadmin Bob

摘要: B. Sysadmin Bobtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEmail address in Berland is a string of the formA@B, whereAandBare arbitrary strings consisting of small Latin letters.Bob is a system administrator in «Bersoft» company. He 阅读全文

posted @ 2012-07-31 20:41 铁树银花 阅读(257) 评论(0) 推荐(0) 编辑

<cf>Worms Evolution

摘要: Worms Evolutiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfessor Vasechkin is studying evolution of worms. Recently he put forward hypotheses that all worms evolve by division. There arenforms of worms. Worms of these forms have lengthsa1 阅读全文

posted @ 2012-07-31 10:50 铁树银花 阅读(321) 评论(0) 推荐(0) 编辑

2012年7月29日

<cf>Hexadecimal's theorem

摘要: A. Hexadecimal's theoremtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not n 阅读全文

posted @ 2012-07-29 23:06 铁树银花 阅读(225) 评论(0) 推荐(0) 编辑

<cf> Prizes, Prizes, more Prizes

摘要: D. Prizes, Prizes, more Prizestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya, like many others, likes to participate in a variety of sweepstakes and lotteries. Now he collects wrappings from a famous chocolate bar "Jupiter". Acco 阅读全文

posted @ 2012-07-29 18:47 铁树银花 阅读(287) 评论(0) 推荐(0) 编辑

<cf>Solitaire(DFS or DP)

摘要: B. Solitairetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA boy named Vasya wants to play an old Russian solitaire called "Accordion". In this solitaire, the player must observe the following rules:A deck ofncards is carefully shuffle 阅读全文

posted @ 2012-07-29 10:31 铁树银花 阅读(314) 评论(0) 推荐(0) 编辑

2012年7月27日

<C++学习笔记>iterator C++

摘要: 迭代器是指向数据集合(比如数组、容器)中的元素的数据类型,它可以通过一系列的操作(如自增运算符++,取值运算符*)遍历数据集合中的元素。 迭代器的一种显著形式是指针。指针可以指向数组中的元素,可以通过自增操作“++”遍历数组中的元素。此外迭代器还有其他形式,例如,每一种类型的容器,如vector,都设置有一个特定形式的“iterator”用于高效低遍历其中的元素。 注意,虽然指针是一种典型的迭代器,但并非所有的迭代器都具有与指针相同的功能。指针具有一些迭代器所不需要具有的功能。 迭代器存在五个分类,这五个类别是根据迭代器所执行的功能划分的,五个类别分别是:输入迭代器,输出迭代器,随机... 阅读全文

posted @ 2012-07-27 23:13 铁树银花 阅读(508) 评论(0) 推荐(0) 编辑

<STL学习笔记>Priority_queue

摘要: 优先队列是一种容器适配器(容器适配器的概念本人不会解释,故此处无法作出说明),它的第一个元素(位于头部top)总是队列中最大的元素,这里的“最大”是指队列元素的严格弱序中的“最大”。严格弱序是一系列数或事物按照一定的比较关系“<”排列得出的序列,“<”可以是数学中进行数值比较的大于,也可以是小于,还可以是其它含义,这大概与离散数学中的“偏序关系”相仿。 在内存充足的情况下,优先队列能被无限地插入元素。 优先队列作为一个容器适配器,它使用其它容器作为底层容器,并提供一系列访问元素的函数。优先队列中的元素从底层容器的“尾部(back)”弹出,即是从队列的顶部(top)弹出。底层容器需要 阅读全文

posted @ 2012-07-27 13:02 铁树银花 阅读(8597) 评论(0) 推荐(0) 编辑

STL学习笔记

摘要: CSDN的文字编辑功能实在不敢恭维,于是只能在博客园写长文章。1.Priority_queue:http://www.cnblogs.com/cszlg/archive/2012/07/27/2611607.html后续内容之后补充 阅读全文

posted @ 2012-07-27 13:00 铁树银花 阅读(144) 评论(0) 推荐(0) 编辑

<fzu1922>非主流

摘要: 非主流Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeFZU 1922Description非主流指不属于主流的事物,如文化上的次文化,宗教上的异端,人群中的异类等。非主流是相对于主流而存在概念。一个事物既可以从非主流变成主流,也可以从主流变为非主流。因此,没有绝对的主流,也不会有绝对的非主流。福大新校区的周围有若干个养鸭场,当然鸭群里面也有另类的。养鸭场的老板认为,这些另类的鸭子,要么可以卖个好价钱,要么一文不值。我们定义每只鸭子的特征为一个一维的0-1向量如: 阅读全文

posted @ 2012-07-27 09:00 铁树银花 阅读(210) 评论(0) 推荐(0) 编辑

2012年7月24日

<cf>Dubstep

摘要: A. Dubsteptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from 阅读全文

posted @ 2012-07-24 22:59 铁树银花 阅读(206) 评论(0) 推荐(0) 编辑

<poj,sicily>Anti-prime Sequences (DFS)

摘要: 1002. Anti-prime Sequences Total:3346Accepted:1220Rating:3.5/5.0(54 votes)Time Limit: 3sec Memory Limit:32MB DescriptionGiven a sequence of consecutive integers n,n+1,n+2,...,m, an anti-prime sequence is a rearrangement of these integers so that each adjacent pair of integers sums to a composite (n. 阅读全文

posted @ 2012-07-24 20:58 铁树银花 阅读(266) 评论(0) 推荐(0) 编辑

Sicily、uva、pc部分题目分类

摘要: Classified Problems on Online Judge 练习题选自以下在线测评系统 * sicily:http://soj.me, 中山大学Sicily在线测评系统 * UVA OnlineJudge, 题号前缀为uva * ProgrammingChanlanges Online Judge, 题号前缀为pc题目的分类仅供参考,很多题目有多种实现,有些题目比较综合,所以或许有不确切或不正确的分类,发现问题请提醒我。1. 编程入门2. 数据结构3. 字符串4. 排序5. 算术与代数6. 组合问题7. 数论8. 搜索: 回溯法,启发式搜索9. 图遍历10. 图算法11. 动态规划 阅读全文

posted @ 2012-07-24 08:52 铁树银花 阅读(1718) 评论(0) 推荐(0) 编辑

2012年7月22日

[置顶] <hduoj>统计难题(字典树)

摘要: 统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 10043Accepted Submission(s): 4077Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统 阅读全文

posted @ 2012-07-22 19:35 铁树银花 阅读(172) 评论(0) 推荐(0) 编辑

[置顶] ASCII码表

摘要: ASCII码表ASCII值控制字符ASCII值控制字符ASCII值控制字符ASCII值控制字符0NUT32(space)64@96、1SOH33!65A97a2STX34”66B98b3ETX35#67C99c4EOT36$68D100d5ENQ37%69E101e6ACK38&70F102f7BEL39,71G103g8BS40(72H104h9HT41)73I105i10LF42*74J106j11VT43+75K107k12FF44,76L108l13CR45-77M109m14SO46.78N110n15SI47/79O111o16DLE48080P112p17DCI49181 阅读全文

posted @ 2012-07-22 09:42 铁树银花 阅读(288) 评论(0) 推荐(0) 编辑

[置顶] 小技巧总结

摘要: 1.识别空行。gets(string), if(strlen(string)==0)则是空行2.结构体的初始化函数可以放在结构体中,这样可以方便地根据需要对某一个节点进行初始化3.常见简写:ans(answer),cnt(count),idx(index,下标),init(initial),str(string),pos(position,位置)4.生成随机数简单的方法:#include <iostream> #include <cstdlib> using namespace std; int main() { for(int i=0;i<5;i++) cout 阅读全文

posted @ 2012-07-22 09:14 铁树银花 阅读(196) 评论(0) 推荐(0) 编辑

2012年7月21日

<poj1047>Round and Round We Go

摘要: Round and Round We GoTime Limit:1000MSMemory Limit:10000KTotal Submissions:10410Accepted:4766DescriptionA cyclic number is an integer n digits in length which, when multiplied by any integer from 1 to n, yields a"cycle"of the digits of the original number. That is, if you consider the numb 阅读全文

posted @ 2012-07-21 19:35 铁树银花 阅读(209) 评论(0) 推荐(0) 编辑

约瑟夫问题

摘要: 问题提出:n个人(编号1~n)围成一个圈,从1开始依次报数,报到m的出列,剩下的人继续从1开始报数(由刚出列的人的下一个人开始)。求最后出列的人(胜利者)的编号。为了讨论方便,先把问题稍微改变一下,并不影响原意:问题描述:n个人(编号0~(n-1)),从0开始报数,报到(m-1)的退出,剩下的人继续从0开始报数。求胜利者的编号。我们知道第一个人(编号一定是m%n-1)出列之后,剩下的n-1个人组成了一个新的约瑟夫环(以编号为k=m%n的人开始):k k+1 k+2 ... n-2, n-1, 0, 1, 2, ... k-2,并且从k开始报0。现在我们把他们的编号做一下转换:k --> 阅读全文

posted @ 2012-07-21 08:59 铁树银花 阅读(180) 评论(0) 推荐(0) 编辑

<hdu2072>单词数(set容器,string类应用)

摘要: 单词数Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15421Accepted Submission(s): 4010Problem Descriptionlily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。Input有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。Outp 阅读全文

posted @ 2012-07-21 08:44 铁树银花 阅读(267) 评论(0) 推荐(0) 编辑

2012年7月20日

志愿者选拔

摘要: F -志愿者选拔Time Limit:1500MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeFZU 1894Description世博会马上就要开幕了,福州大学组织了一次志愿者选拔活动。参加志愿者选拔的同学们排队接受面试官们的面试。参加面试的同学们按照先来先面试并且先结束的原则接受面试官们的考查。面试中每个人的人品是主要考查对象之一。(提高人品的方法有扶老奶奶过街,不闯红灯等)作为主面试官的John想知道当前正在接受面试的同学队伍中人品值最高的是多少。于是他请你帮忙编写一个程序来计算。Inp 阅读全文

posted @ 2012-07-20 17:32 铁树银花 阅读(266) 评论(0) 推荐(0) 编辑

2012年7月18日

error: invalid use of incomplete type 'struct word'|

摘要: 发生错误的程序:#include <stdio.h>#include <string.h>#include <algorithm>int cmp(const void* x,const void* y){ struct word* xx=(word*)x; struct word* yy=(word*)y; return strcmp(xx->a,yy->a);}struct word{ char a[26];}w[1000];int main(){……}错因:结构体的声明和定义在cmp函数之后 阅读全文

posted @ 2012-07-18 23:06 铁树银花 阅读(2881) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8 9 10 下一页

导航