hdu1496 Equations(哈希表)
来源:互联网 发布:中国知网专利数据库 编辑:程序博客网 时间:2024/06/05 20:05
打完哈希表后记得剪枝,我噗这题数据对时间要求挺高的。
#include <stdio.h>#include <algorithm>#include <string.h>using namespace std;const int N = 2000005;int main(){ // freopen("in.txt", "r", stdin); int a, b, c, d; int Hash[N]; while(~scanf("%d%d%d%d", &a, &b, &c, &d)) { if(a * b > 0 && b * c > 0 && c * 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 * i * i + b * j * j + 1000000] ++; int ans = 0; for(int i = 1; i <= 100; i ++) for(int j = 1; j <= 100; j ++) ans += Hash[- c * i * i - d * j * j + 1000000]; printf("%d\n", 16 * ans); } return 0;}
0 0
- hdu1496 Equations(哈希表)
- HDU1496:Equations(二分)
- hdu1496 Equations(hash表)
- hdu1496—Equations(枚举)
- HDU1496--Equations
- HDU1496 Equations
- Equations hdu1496(hash)
- hdu1496 Equations Hash
- hdu1496 Equations (hash)
- hdu1496
- HDU1496
- hdu 1496 Equations(哈希表)
- hdu 1496 Equations(暴力,哈希表 剪枝)
- hdu1496(用hash思想统计数目)
- hdu1496 equation(较好的hash)
- Equations(数学,水)
- Equations(哈希)
- Equations(哈希)
- 什么是多项式算法、非多项式算法
- 算法导论 练习 2.3-3
- win10 uwp iot
- Html笔记 3
- oscache
- hdu1496 Equations(哈希表)
- 我要成为一个技术大牛啊
- NKOI 3662 划区灌溉
- Leecode 8: String to Integer (atio)
- c 编译器及#define和typedef
- Android Activity彻底运行起来之后的回调onPostCreate( )
- [概率DP] Topcoder SRM687div2 1000 Queueing
- quartus ii 11.0安装破解破解方法:
- 利用Xcode Profile和Analyze进行性能优化