HDU 1496 Equations
2013-10-09 23:49
211 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1496
#include <cstdio> #include <cstring> int hash[2001000], p[101]; int main( ) { int a, b, c, d; for(int i=1; i<101; i++) p[i] = i*i; while(~scanf("%d%d%d%d", &a, &b, &c, &d)) { int sum = 0; if((a>0 && b>0&& c>0 && d>0) || (a<0 && b<0 && c<0 && d<0)) { printf("0\n"); continue; } memset(hash,0,sizeof(hash)); for(int i=1; i<=100; i++) for(int j=1; j<=100; j++) hash[a*p[i] + b*p[j] + 1000000]++; for(int i=1; i<=100; i++) for(int j=1; j <= 100; j ++) sum += hash[1000000 - c*p[i] - d*p[j]]; printf("%d\n", sum<<4); } return 0; }
相关文章推荐
- HDU 1496 Equations(hash)
- hdu1496 Equations(hash表)
- HDU 1496 Equations
- HDU 1496 Equations
- hdu 1496 -- Equations
- hdu_1496_equations( 二分 or hash )
- HDU 1496 Equations
- hdu 1496 -- Equations(哈希)
- hdu 1496 Equations (整数Hash)
- hdu 1496 equations(哈希)
- HDU 1496 Equations (hash)
- HDU 1496 Equations(哈希表)
- HDU 1496 Equations(哈希打表+二分暴力)
- hdu 1496 Equations(hash)@
- HDU 1496 Equations
- HDU 1496 Equations(hash or 二分)
- (HDU - 1496)Equations
- hdu 题目1496 Equations , POJ 题目1840 Eqs (整数Hash)
- HDU_1496 Equations && POJ_1840 Eqs(Hash)
- hdu 1496 Equations(hash备忘)