![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 72
ENGOW
这个作者很懒,什么都没留下…
展开
-
A even and odd(13.7.6)
#includeusing namespace std;int main(){ long long n,k; while(cin>>n>>k){ if(n%2!=0){ if(k<=((n+1)/2)){ cout<<(2*k-1)<<endl;} else{cout<<2*(k-(n+1)/2)<<endl;}} else{ if(k<=n/2){原创 2013-07-06 19:52:41 · 567 阅读 · 0 评论 -
Robberies(HDOJ2955)
RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7620 Accepted Submission(s): 2859Problem DescriptionThe aspiring Roy原创 2013-07-19 17:20:01 · 506 阅读 · 0 评论 -
饭卡(HDOJ2546)
HDOJ2546饭卡原创 2013-07-18 15:56:54 · 707 阅读 · 0 评论 -
Bone Collector(HDOJ2602)
Bone CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 20880 Accepted Submission(s): 8345Problem DescriptionMany years原创 2013-07-18 15:50:45 · 431 阅读 · 0 评论 -
最佳子矩阵的算法
1、最大子段和问题 问题定义:对于给定序列a1,a2,a3……an,寻找它的某个连续子段,使得其和最大。如( -2,11,-4,13,-5,-2 )最大子段是{ 11,-4,13 }其和为20。 (1)枚举法求解 枚举法思路如下: 以a[0]开始: {a[0]}, {a[0],a[1]},{a[0],a[1],a[2]}……{a[0]转载 2013-07-16 17:23:12 · 953 阅读 · 0 评论 -
B~A simple problem(13.7.12)
B. A simple problemDescriptionDreamone has a lovely cat. The cat can comfort you if you are very dejected, she can also play with you ifyou are very bored. So Dreamone loves her very much. Of co原创 2013-07-13 21:16:39 · 471 阅读 · 0 评论 -
H~Little Sheep and a paper(13.7.11)
Problem H. Little Sheep and a paperInput le: stdinOutput le: stdoutTime limit: 2 secondsOne day, Little Sheep gets an AK(all kill) in a contest, so he is very boring, then he just plays with a原创 2013-07-13 21:06:26 · 625 阅读 · 0 评论 -
F~Help Johnny(13.7.12)
F. Help JohnnyDescriptionPoor Johnny is so busy this term. His tutor threw lots of hard problems to him and demanded him toaccomplish those problems in a month. What a wicked tutor! After cursin原创 2013-07-13 21:20:59 · 493 阅读 · 0 评论 -
I~Matrix(13.7.11)
Problem I. MatrixInput le: stdinOutput le: stdoutTime limit: 2 secondsTo ecient calculate the multiplication of a sparse matrix is very useful in industrial led. Let's considerthis problem:原创 2013-07-13 21:13:00 · 1270 阅读 · 0 评论 -
E~The mell hall(13.7.9)
Problem E. The mell hallInput le: stdinOutput le: stdoutTime limit: 2 secondsIn HUST,there are always many students go to the mell hall at the same time as soon as the bell rings.Students ha原创 2013-07-10 20:08:46 · 525 阅读 · 0 评论 -
E.Function(13.7.8)
E.Function Define a functionf(n)=(f(n-1)+1)/f(n-2). You already got f(1) and f(2). Now, give you a numberm, please find the value of f(m). Input There are several test cases. Each原创 2013-07-10 19:53:03 · 1722 阅读 · 0 评论 -
快速幂
所谓的快速幂,实际上是快速幂取模的缩写,简单的说,就是快速的求一个幂式的模(余)。在程序设计过程中,经常要去求一些大数对于某个数的余数(素数测试),为了得到更快、计算范围更大的算法,产生了快速幂取模算法。我们先从简单的例子入手:求a ^ b % c = ?算法1.首先直接地来设计这个算法:[cpp] view plaincopyprint转载 2013-07-11 09:55:49 · 521 阅读 · 0 评论 -
A.Eming(13.7.7)
A.Eming Eming is a contest hold by WHUACM trainingteam. The aim is to select new members of the team. Usually, the first problem is a very simpleproblem such as “a+b problem”. But this原创 2013-07-10 19:58:15 · 484 阅读 · 0 评论 -
D.Brackets(13.7.8)
D.Brackets This year MK is 5 years old. So he decides to learnsomearithmetic. But he was confused by how towrite the brackets. He has already known that the brackets should match whenwriting the原创 2013-07-10 19:42:32 · 545 阅读 · 0 评论 -
B.Arithmetic Progression(13.7.7)
B.Arithmetic Progression “Inmathematics, an arithmetic progression (AP) or arithmetic sequence is asequence of numbers such that the difference between the consecutive terms isconstant. For instanc原创 2013-07-10 19:22:27 · 572 阅读 · 0 评论 -
蜗牛!快爬!(小学算术问题)
Problem Description很久以前有一只蚂蚁,某天在路上走着走着,突然看见了一只蜗牛,爬的很慢。心想自己虽然比它小,可是跑得比它快,于是蚂蚁想跟蜗牛进行一次马拉松比赛,想证明它的实力。蚂蚁跟蜗牛商量后决定在星期六下午进行马拉松比赛。Theday is coming….比赛跑道为一条直线,Unlucky!!跑道上有很多坑。注意哦,坑!蜗牛想知道它掉下坑底后,爬上来需要多少时间,你原创 2013-07-10 10:47:29 · 1004 阅读 · 0 评论 -
一二三(The Seventh Hunan Collegiate Programming Contest)
一二三你弟弟刚刚学会写英语的一(one)、二(two)和三(three)。他在纸上写了好些一二三,可惜有些字母写错了。已知每个单词最多有一个字母写错了(单词长度肯定不会错),你能认出他写的啥吗?输入第一行为单词的个数(不超过10)。以下每行为一个单词,单词长度正确,且最多有一个字母写错。所有字母都是小写的。输出对于每组测试数据,输出一行,即该单词的阿拉伯数字。输入保证只有一种理解方原创 2013-08-25 17:26:28 · 1342 阅读 · 0 评论