摘要:
这两题的思路都是将等式化成左右两部分,用一个hash数组,先把左边的结果存起来,然后计算右边的结果直接寻址就行,不过,HDU那道题要注意剪枝,如果系数全为正或者全为负则直接输出0,POJ那道题hash函数定义成char型的,否则会超内存。。 HDU_1496 Equations:#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int N = 2000009;int hash[N];int main(){ //freopen("data.i 阅读全文
posted @ 2011-08-20 09:03
AC_Von
阅读(206)
评论(0)
推荐(0)