摘要:
1)给定一个矩阵,矩阵每个位置都有对应的数值。从矩阵左上角到右下角,找出最小和 阅读全文
摘要:
The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each 阅读全文
摘要:
大家知道Fibonacci数列吧, f[1]=1, f[2]=1, f[3]=2, f[4]=3…, 也就是f[n]=f[n-1]+f[n-2],现在问题很简单,输入n和m,求前n项和取模m。 阅读全文
摘要:
Description 马上要上体育课了,上体育课之前总归是要排个队的,ly作为班长,怎么排队的问题只能由她来解决,但是马上要上课了,ly又不清楚所有人的身高,她又不好意思问每个人的身高,因为这样会显的自己很不负责,于是她只能通过肉眼观察...那么问题来了,她只能观察出两个人A和B谁高谁矮,但是她没 阅读全文
摘要:
Kahn算法:1)从有向图中选一个没有入度的顶点 2)从图中删除所有和它有关的边 3)重复上述步骤,直至所有顶点输出,或者只剩下环 (可以判断一个图是否有环) 暴力解法: 阅读全文
该文被密码保护。 阅读全文
摘要:
Friends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is charged at a1 percent and second 阅读全文
摘要:
题目描述把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。 输入每行均包含二个整数M和N,以空格分开。1<=M,N<=10。 输出对输入的每组数据M和N,用一行输出相应的K。 样例输入: 7 3 输出 : 8 阅读全文
摘要:
You are given two integers xx and yy (it is guaranteed that x>yx>y). You may choose any prime integer pp and subtract it any number of times from xx. 阅读全文
摘要:
You have two integers ll and rr. Find an integer xx which satisfies the conditions below: l≤x≤rl≤x≤r. All digits of xx are different. If there are mul 阅读全文