随笔 - 390,  文章 - 34,  评论 - 62,  阅读 - 139万

随笔分类 -  STL

1
NYOJ-267 郁闷的C小加(二)
摘要:郁闷的C小加(二)时间限制:1000 ms | 内存限制:65535 KB难度:4描述聪明的你帮助C小加解决了中缀表达式到后缀表达式的转换(详情请参考“郁闷的C小加(一)”),C小加很高兴。但C小加是个爱思考的人,他又想通过这种方法计算一个表达式的值。即先把表达式转换为后缀表达式,再求值。这时又要考虑操作数是小数和多位数的情况。输入第一行输入一个整数T,共有T组测试数据(T 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 char str[1005]; 10 stack... 阅读全文
posted @ 2013-06-30 16:58 可笑痴狂 阅读(500) 评论(0) 推荐(0) 编辑
HDOJ-3785 寻找大富翁(优先队列)
摘要:寻找大富翁Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2248Accepted Submission(s): 1081Problem Description浙江桐乡乌镇共有n个人,请找出该镇上的前m个大富翁.Input输入包含多组测试用例.每个用例首先包含2个整数n(0 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 void se... 阅读全文
posted @ 2013-06-29 20:47 可笑痴狂 阅读(453) 评论(0) 推荐(0) 编辑
HDOJ-1509 Windows Message Queue(优先队列)
摘要:Windows Message QueueTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2264Accepted Submission(s): 884Problem DescriptionMessage queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something ha 阅读全文
posted @ 2013-04-26 20:49 可笑痴狂 阅读(277) 评论(0) 推荐(0) 编辑
POJ-2227 The Wedding Juicer(NYOJ-547 Interesting Punch-Bowl)
摘要:The Wedding JuicerTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 2803Accepted: 1225DescriptionFarmer John's cows have taken a side job designing interesting punch-bowl designs. The designs are created as follows: * A flat board of size W cm x H cm is procured (3 <= W <= 300, 3 &l 阅读全文
posted @ 2013-04-25 20:57 可笑痴狂 阅读(672) 评论(0) 推荐(0) 编辑
POJ-1606 Jugs
摘要:JugsTime Limit:1000MSMemory Limit:65536KTotal Submissions:4076Accepted:2411Special JudgeDescriptionIn the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon jug and were asked to fill the 5-gallon 阅读全文
posted @ 2012-11-20 20:45 可笑痴狂 阅读(3989) 评论(0) 推荐(0) 编辑
HDU 1896 Stones 优先队列
摘要:StonesTime Limit: 5000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 455Accepted Submission(s): 261Problem DescriptionBecause of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a littl 阅读全文
posted @ 2012-08-29 12:34 可笑痴狂 阅读(373) 评论(0) 推荐(0) 编辑
NYOJ -55 懒省事的小明
摘要:懒省事的小明时间限制:3000 ms | 内存限制:65535 KB难度:3描述 小明很想吃果子,正好果园果子熟了。在果园里,小明已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆。小明决定把所有的果子合成一堆。 因为小明比较懒,为了省力气,小明开始想点子了: 每一次合并,小明可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之和。可以看出,所有的果子经过n-1次合并之后,就只剩下一堆了。小明在合并果子时总共消耗的体力等于每次合并所耗体力之和。 因为还要花大力气把这些果子搬回家,所以小明在合并果子时要尽可能地节省体力。假定每个果子重量都为1,并且已知果子的种类数和每种果子的... 阅读全文
posted @ 2012-08-13 22:42 可笑痴狂 阅读(333) 评论(0) 推荐(0) 编辑
NYOJ 257 郁闷的C小加(一)
摘要:郁闷的C小加(一)时间限制:1000 ms | 内存限制:65535 KB难度:3描述我们熟悉的表达式如a+b、a+b*(c+d)等都属于中缀表达式。中缀表达式就是(对于双目运算符来说)操作符在两个操作数中间:num1 operand num2。同理,后缀表达式就是操作符在两个操作数之后:num1 num2 operand。ACM队的“C小加”正在郁闷怎样把一个中缀表达式转换为后缀表达式,现在请你设计一个程序,帮助C小加把中缀表达式转换成后缀表达式。为简化问题,操作数均为个位数,操作符只有+-*/ 和小括号。输入第一行输入T,表示有T组测试数据(T<10)。每组测试数据只有一行,是一个长 阅读全文
posted @ 2012-08-05 21:10 可笑痴狂 阅读(342) 评论(0) 推荐(0) 编辑
POJ-1521 Entropy 赫夫曼编码
摘要:EntropyTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 3314Accepted: 1323DescriptionAn entropy encoder is a data encoding method that achieves lossless data compression by encoding a message with "wasted" or "extra" information removed. In other words, entropy encoding r 阅读全文
posted @ 2012-08-04 13:26 可笑痴狂 阅读(1035) 评论(0) 推荐(0) 编辑
NYOJ-128前缀式计算
摘要:前缀式计算时间限制:1000 ms | 内存限制:65535 KB难度:3描述先说明一下什么是中缀式:如2+(3+4)*5这种我们最常见的式子就是中缀式。而把中缀式按运算顺序加上括号就是:(2+((3+4)*5))然后把运算符写到括号前面就是+(2 *( +(3 4) 5) )把括号去掉就是:+ 2 * + 3 4 5最后这个式子就是该表达式的前缀表示。给你一个前缀表达式,请你计算出该前缀式的值。比如:+ 2 * + 3 4 5的值就是 37输入有多组测试数据,每组测试数据占一行,任意两个操作符之间,任意两个操作数之间,操作数与操作符之间都有一个空格。输入的两个操作数可能是小数,数据保证输入的 阅读全文
posted @ 2012-08-04 13:13 可笑痴狂 阅读(583) 评论(0) 推荐(0) 编辑
NYOJ-305 表达式求值
摘要:表达式求值时间限制:3000 ms | 内存限制:65535 KB难度:3描述Dr.Kong设计的机器人卡多掌握了加减法运算以后,最近又学会了一些简单的函数求值,比如,它知道函数min(20,23)的值是20,add(10,98)的值是108等等。经过训练,Dr.Kong设计的机器人卡多甚至会计算一种嵌套的更复杂的表达式。假设表达式可以简单定义为:1.一个正的十进制数x是一个表达式。2.如果x和y是表达式,则函数min(x,y)也是表达式,其值为x,y中的最小数。3.如果x和y是表达式,则函数max(x,y)也是表达式,其值为x,y中的最大数。4.如果x和y是表达式,则函数add(x,y)也是 阅读全文
posted @ 2012-08-03 22:18 可笑痴狂 阅读(1437) 评论(0) 推荐(0) 编辑
NYOJ-35 表达式求值
摘要:表达式求值时间限制:3000 ms | 内存限制:65535 KB难度:4描述ACM队的mdd想做一个计算器,但是,他要做的不仅仅是一计算一个A+B的计算器,他想实现随便输入一个表达式都能求出它的值的计算器,现在请你帮助他来实现这个计算器吧。比如输入:“1+2/4=”,程序就输出1.50(结果保留两位小数)输入第一行输入一个整数n,共有n组测试数据(n<10)。每组测试数据只有一行,是一个长度不超过1000的字符串,表示这个运算式,每个运算式都是以“=”结束。这个表达式里只包含+-*/与小括号这几种符号。其中小括号可以嵌套使用。数据保证输入的操作数中不会出现负数。数据保证除数不会为0输出 阅读全文
posted @ 2012-08-02 23:57 可笑痴狂 阅读(1033) 评论(0) 推荐(0) 编辑
NYOJ-366 D的小L 全排列
摘要:D的小L时间限制:4000 ms | 内存限制:65535 KB难度:2描述 一天TC的匡匡找ACM的小L玩三国杀,但是这会小L忙着哩,不想和匡匡玩但又怕匡匡生气,这时小L给匡匡出了个题目想难倒匡匡(小L很D吧),有一个数n(0<n<10),写出1到n的全排列,这时匡匡有点囧了,,,聪明的你能帮匡匡解围吗?输入第一行输入一个数N(0<N<10),表示有N组测试数据。后面的N行输入多组输入数据,每组输入数据都是一个整数x(0<x<10)输出按特定顺序输出所有组合。特定顺序:每一个组合中的值从小到大排列,组合之间按字典序排列。样例输入223样例输出1221123 阅读全文
posted @ 2012-08-02 20:58 可笑痴狂 阅读(497) 评论(0) 推荐(0) 编辑
POJ-3250 Bad Hair Day 单调栈
摘要:Bad Hair DayTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 10300Accepted: 3458DescriptionSome of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top 阅读全文
posted @ 2012-08-02 11:17 可笑痴狂 阅读(1735) 评论(0) 推荐(1) 编辑
POJ-1028 Web Navigation
摘要:Web NavigationTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 23885Accepted: 10653DescriptionStandard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features is to use two stacks to keep track of the pages that can be 阅读全文
posted @ 2012-08-02 09:13 可笑痴狂 阅读(2756) 评论(0) 推荐(0) 编辑
TOJ-3072 Train Order
摘要:Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 313 Accepted Runs: 160There is a railway station in PopPush City (See the picture below). All the trains arriving from A are numbered 1,2,3,...N. The station is dead-end, and some trains may stop here temporarily to let the behind trains pass b 阅读全文
posted @ 2012-08-01 17:29 可笑痴狂 阅读(585) 评论(1) 推荐(0) 编辑
TOJ-1036.Rails STL-栈
摘要:1 /* 2 功能Function Description: STL-栈 TOJ-1036.Rails zoj-1259 poj-1363 3 开发环境Environment: DEV C++ 4.9.9.1 4 技术特点Technique: 5 版本Version: 6 作者Author: 可笑痴狂 7 日期Date: 20120801 8 备注Notes: 9 题目来源:10 http://acm.tju.edu.cn/to... 阅读全文
posted @ 2012-08-01 15:03 可笑痴狂 阅读(529) 评论(0) 推荐(0) 编辑
POJ 3278 Catch That Cow
摘要:Catch That CowTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 30924Accepted: 9536DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100, 阅读全文
posted @ 2012-07-30 09:22 可笑痴狂 阅读(2686) 评论(1) 推荐(0) 编辑
HDOJ 1372 Knight Moves
摘要:Knight MovesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3340Accepted Submission(s): 2087Problem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves th 阅读全文
posted @ 2012-07-25 11:46 可笑痴狂 阅读(519) 评论(0) 推荐(0) 编辑
NYOJ-150 Train Problem I
摘要:Train Problem I时间限制:3000 ms | 内存限制:65535 KB难度:1描述As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a problem, there is o 阅读全文
posted @ 2012-07-20 16:55 可笑痴狂 阅读(1302) 评论(2) 推荐(1) 编辑

1

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示