摘要:
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=309题意:很好理解就是选手可以选择加速,或者保持速度不变,但在要求的点处速度不能超过给定的值。思路就是从起点开始不断加速,到有限制点时比较当前的速度和限制速度,如果当前速度小于限制速度则继续进行,否则,把当前的速度改为限制速度继续进行,直到最后,将结果保存到一个数组中,然后从后向前做同样的操作,直到0,不同之处在于在终点时的初始速度不能为1,而应该为不能达到的速度,将结果保存在另一个数组中,比较上面的两个数组,取相同位置的最小值,这样在这些值里边找最大的就是最求的最大速度。View C 阅读全文
摘要:
题目链接:http://acm.tju.edu.cn/toj/showp2196.htmlView Code 1 #include<iostream> 2 #include<cmath> 3 #include<cstring> 4 #include<set> 5 using namespace std; 6 int main() 7 { 8 int i,j,k,n,m,t; 9 char ch;10 multiset<int>st2;11 multiset<int>::iterator in2;12 while (cin& 阅读全文