摘要:
MMM got a big big big cake, and invited all her M friends to eat the cake together. Surprisingly one of her friends HZ took some (N) strawberries which MMM likes very much to decorate the cake (of course they also eat strawberries, not just for decoration). HZ is in charge of the decoration, and he 阅读全文
摘要:
XX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,痛苦呀 ),但XX星人对时间却没那么多要求。要你找出一条城市间的最舒适的路径。(SARS是双向的)。Input输入包括多个测试实例,每个实例包括:第一行有2个正整数n (1 2 #include 3 #include 4 using 阅读全文
摘要:
http://poj.org/problem?id=1942题意:一个n*m的格子,从左下角走到右上角有多少种走法,规定只能向上或向右走;思路:解法挺水的,高中学组合数的时候老师给讲过;求C[m+n][n]就可以; 但是这里n,m是32位以内的数,要用double,输出的时候只输出整数部分; 1 #include 2 #include 3 using namespace std; 4 5 double n,m,ans; 6 int main() 7 { 8 cout>n>>m)10 {11 if(n == 0 && m == 0)12 ... 阅读全文