摘要: 我的错误代码#include "iostream"#include "math.h"#include "algorithm"#define N 100000;using namespace std;int total,list[1000],n,m,MIN,top,step,data[1000];void dfs(int a){ int i,j,num; if(total>m)return; if(m-total>m>>n&&m&&n){ top=1;step=1; while(n 阅读全文
posted @ 2013-10-02 20:12 龙城星 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 我的代码是错的,第一次是超时,后来看了人家的代码,才知道原来可以用一个数组来节省时间我的错误的代码原因:搜索比n小的数字,此时为了搜索到的解 m 是最小的,应该从区间[0,s]的第s位开始向第0位搜索,因为在相同 pnum 情况下,把高位数字变小所得到的 m 值更小。我的错误代码#include "iostream"#include "math.h"#include "algorithm"#include "string.h"#define N 10000000;using namespace std;int to 阅读全文
posted @ 2013-10-02 20:09 龙城星 阅读(185) 评论(0) 推荐(0) 编辑