![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM生涯
文章平均质量分 82
cnzhanj
这个作者很懒,什么都没留下…
展开
-
hdu2177取(2堆)石子游戏
有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。如果你胜,你第1次怎样取子?原创 2015-03-30 16:25:56 · 906 阅读 · 0 评论 -
hdu1010Tempter of the Bone
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, and the doggie could feel the ground sinking. He realized that the bone was a trap, and he tried desperately to get out of this原创 2015-03-18 19:04:41 · 461 阅读 · 0 评论 -
hdu1434幸福列车
一批幸福的列车即将从杭州驶向幸福的终点站——温州,身为总列车长的linle有一些奇怪的癖好。他会记录下全部乘客的名字(name)和他们的人品值(RP),根据这些将他们排序,并不时地从某辆列车里踢出人品最不好(RP值最低)的一个人,当两个人人品一样不好时,他就会踢出名字难听的人(linle认为按字典顺序,排在越在后面的人名字越难听)。当然出于列车行驶需要,他还会不时的发布一些命令,比如让某个乘客上车,合并某两辆列车等。linle的上一任秘书***因为不能高效地执行他的这些命令而被炒鱿鱼,他现在正在原创 2015-03-17 10:16:03 · 673 阅读 · 0 评论 -
hdu1873看病要排队
看病要排队这个是地球人都知道的常识。不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的病人的话,则选择最早来排队的病人。现在就请你帮助医院模拟这个看病过程。原创 2015-03-15 20:24:18 · 638 阅读 · 0 评论 -
hdu022Train Problem I
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 only o原创 2015-03-15 14:24:25 · 515 阅读 · 0 评论 -
hdu1509Windows Message Queue
Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text change, the system will add a message to the queue. Meanwhile, the process wil原创 2015-03-15 14:16:49 · 680 阅读 · 0 评论 -
hdu1015Safecracker
=== Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, along with Klein and his factory, were destroyed in World War II. Fortunately o原创 2015-03-14 20:29:29 · 615 阅读 · 0 评论 -
hdu1172猜数字
猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么。每猜一个数,计算机都会告诉玩家猜对几个数字,其中有几个数字在正确的位置上。比如计算机随机产生的数字为1122。如果玩家猜1234,因为1,2这两个数字同时存在于这两个数中,而且1在这两个数中的位置是相同的,所以计算机会告诉玩家猜对了2个数字,其中一个在正确的位置。如果玩家猜1111,那么计算机会告诉他猜对2个数字,有2个在正确的位置。现在给你一段gameboy与计算机的对话过程,你的任务原创 2015-03-14 18:35:27 · 836 阅读 · 0 评论 -
hdu2844
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact price(without change) and he known th原创 2015-03-27 21:37:51 · 463 阅读 · 0 评论 -
hdu1087Super Jumping! Jumping! Jumping!
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can be played by two or more than two players. It consis原创 2015-03-29 10:53:24 · 526 阅读 · 0 评论 -
hdu2176取(m堆)石子游戏
m堆石子,两人轮流取.只能在1堆中取.取完者胜.先取者负输出No.先取者胜输出Yes,然后输出怎样取子.例如5堆 5,7,8,9,10先取者胜,先取者第1次取时可以从有8个的那一堆取走7个剩下1个,也可以从有9个的中那一堆取走9个剩下0个,也可以从有10个的中那一堆取走7个剩下3个.原创 2015-03-31 11:17:59 · 835 阅读 · 0 评论 -
浅谈快速排序
快速排序,简称快排,对于一个包含n个输入数组来说,快速排序是一种最坏情况时间复杂度为O(n^2)的排序算法,虽然最坏情况的时间复杂度很差,但是快速排序通常是实际排序应用中最好的选择,因为他的平均性能很好,他的期望时间复杂度为O(n lg n)。快速排序的函数qsort,它包含在头文件里,函数一共四个参数,在函数头部加上头文件#include,就可以直接调用,并且无需声明。一个典型的qsort的原创 2014-12-04 13:16:44 · 998 阅读 · 1 评论