摘要:
1. 枚举可以算出来,但是肯定超时,所以要剪枝,以等差数列a+nb说明;2. 几个可以剪枝的地方:b的范围是从1~2*m*m/(n-1); a的范围是0~2*m*m - (n-1) * b然后循环判断是不是pq了剪枝不是很充分,但是最慢3秒多给过了,哈哈3.以下是代码:/*
ID: dollar4
PROG: ariprog
LANG: C++
*/
#include #include #include #include #include using namespace std; int main()
{ ofstream fout ("ariprog.out"); ... 阅读全文
posted @ 2012-04-14 23:04
赵乐ACM
阅读(394)
评论(0)
推荐(0)