摘要:
题目描述N integers are arranged on a circle clockwise. Given two integers M and K. For each position, you should take M continuous integers on the left an... 阅读全文
摘要:
题目描述Nancy, the leader of a group, always participates in many different kinds of competitions. One day, she decides to choose some of her group member... 阅读全文
摘要:
题目描述华科校园的规划相当整齐,横平竖直,只要知道方向,你就不会迷路。具体是这样的,华科的校园是n*m的格子形状(如下所示),格子是建筑物,不能通过,只能走格子线,每走动一格花费时间1s。现在有一个同学想用最短的时间从右上角走到左下角,请问他有多少种方法?上图表示了在4 * 5的格子上的可能的两种方... 阅读全文
摘要:
上次我说用STL超时了,而用数组为0ms,其实不然,这个题STL依然不超时,代码如下#include#include#include#include#include#include#include#include#include#include#include#include#define inf... 阅读全文
摘要:
最长公共子系列,简单的dp,不过注意有空格,所以,在读字符串的时候,尽量用gets读,这样基本没问题#include#include#include#includeusing namespace std;int dp[1001][1001];int MAX(int x,int y){ if (... 阅读全文
摘要:
Problem Description在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。Input每行只有一个正整数N,N小于32768。Output对应每个输入,输出兑换方法数。Sample Input293412553Sample Output71... 阅读全文
摘要:
Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of mone... 阅读全文
摘要:
题目描述You’re giving a party in the garden of your villa by the sea. The party is a huge success, and everyone is here. It’s a warm, sunny evening, and a... 阅读全文
摘要:
题目描述You are organizing a dance party. The party will be attended by n boys and n girls. There will be several rounds of dancing. In each round, you di... 阅读全文
摘要:
和上一题差不多,都是用最大流来做,可是有人能告诉我STL和直接用数组,真的有那么大区别吗?STL超时,数组0ms,这是什么数据,有那么叼吗附上两份代码!希望过路的人能给我看看为什么会超时STL的#include#include#include#include#include#include#incl... 阅读全文