12 2014 档案
摘要:中文描述: Description 给你一个5*6的矩阵,矩阵里每一个单元都有一个灯和一个开关,如果按下此开关,那么开关所在位置的 那个灯和开关前后左右的灯的状态都会改变 (即由亮到不亮或由不亮到亮)。给你一个初始的灯的状态, 问怎样控制每一个开关使得所有的灯最后全部熄灭。 Input 输...
阅读全文
摘要:Sum Sum Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 166 Accepted Submission(s):...
阅读全文
摘要:Description There must be many A + B problems in our HDOJ , now a new one is coming. Give you two hexadecimal integers , your task is to calcu...
阅读全文
摘要:Description Given two rectangles and the coordinates of two points on the diagonals of each rectangle,you have to calculate the area of the inter...
阅读全文
摘要:Problem Description Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Input each test case contains two nu...
阅读全文
摘要:Problem Description 国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的: 首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排; 然后,让各位新郎寻找自己的新娘...
阅读全文
摘要:这个题,要用到错排递推公式,还有全排。 还有,最近比赛啥的老是不爽,结果通过这个题竟然发现了自己的毛病,printf(“%lf”)输出double型怎么弄也是输出0.00,调试了半天,还以为C语言编译器犯病了。后来才知道输出时应该用f,无语了。发现自己太水了。。。好好努力吧。。 #inclu...
阅读全文
摘要:Problem Description Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Prince...
阅读全文
摘要:Problem Description Fibonacci数列,定义如下: f(1)=f(2)=1 f(n)=f(n-1)+f(n-2) n>=3。 计算第n项Fibonacci数值。 Input 输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)。 ...
阅读全文
摘要:How Many Fibs? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4592 Accepted Submission(...
阅读全文
摘要:Exponentiation Time Limit: 1000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7275 Accepted Submission(s...
阅读全文
摘要:Integer Inquiry Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13470 Accepted Submissio...
阅读全文
摘要:方法一:最简单的方法,直接使用STL中的next_permutation函数生成排列 #include using namespace std;int main(){ char res[] = "ABCD"; do{ puts(res); }while(next...
阅读全文
摘要:The sequence of n - 1 consecutive composite numbers (positive integers that are not prime and not equal to 1) lying between two successive prime nu...
阅读全文
摘要:A: Zombie's Treasure Chest Some brave warriors come to a lost village. They are very lucky and find a lot of treasures and a big treas...
阅读全文
摘要:Count on Cantor One of the famous proofs of modern mathematics is Georg Cantor's demonstration that the set of rational numbers is enum...
阅读全文
摘要:Bandwidth Given a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and an ordering on the elements in V, then the b...
阅读全文
摘要:Krypton Factor You have been employed by the organisers of a Super Krypton Factor Contest in which contestants have very high mental an...
阅读全文
摘要:Prime Ring Problem A ring is composed of n (even number) circles as shown in diagram. Put natural numbers into each circle separately...
阅读全文
摘要:Problem A: Fractions Again?! Time limit: 1 second It is easy to see that for every fraction in the form (k > 0), we can always find tw...
阅读全文
摘要:Problem D - Maximum Product Time Limit: 1 second Given a sequence of integers S = {S1, S2, ..., Sn}, you should determine what is the value of t...
阅读全文
摘要:Division Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, ...
阅读全文
摘要:A robot has to patrol around a rectangular area which is in a form of mxn grid (m rows and n columns). The rows are labeled from 1 to m. The colum...
阅读全文
摘要:Knight Moves A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of ...
阅读全文
摘要:Tree Recovery Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary t...
阅读全文
摘要:S-Trees A Strange Tree (S-tree) over the variable set is a binary tree representing a Boolean function . Each path of the S-tree beg...
阅读全文
摘要:Parentheses Balance You are given a string consisting of parentheses () and []. A string of this type is said to be correct: (a)if it ...
阅读全文
摘要:Updating a Dictionary In this problem, a dictionary is collection of key-value pairs, where keys are lower-case letters, and values ar...
阅读全文
摘要:Problem F Ordering Tasks Input: standard input Output: standard output Time Limit: 1 second Memory Limit: 32 MB John has n tasks to do. Unfortunat...
阅读全文
摘要:闲来无事,学到了Rand函数的用法,于是想到实现一个控制台抽奖的程序 程序功能比较简单,输入一个数值作为随机数的范围,为[1,range],通过不断按回车产生随机数,停止回车时固定。通过system(“cls”)实现清除之前的数据。输入任意其他字符+回车可以更换随机数范围。Ctrl+Z可停止程序...
阅读全文
摘要:Problem B Broken Keyboard (a.k.a. Beiju Text) You're typing a long text with a broken keyboard. Well it's not so badly broken. The only problem w...
阅读全文
摘要:Rails There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. U...
阅读全文
摘要:Peter studies the theory of relational databases. Table in the relational database consists of values that are arranged in rows and columns. There...
阅读全文
摘要:书上的代码交上去Runtime Error,故按照自己的思路重写了 #include using namespace std;int main(){#ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); freopen("o...
阅读全文

浙公网安备 33010602011771号