HDU4993 Revenge of ex-Euclid(hash)
来源:互联网 发布:linux如何进入文件夹 编辑:程序博客网 时间:2024/06/04 18:55
看到这题就条件反射的想到了hash......
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int hash[1000001];int main(){ int T; //freopen("d:\\test.txt","r",stdin); cin>>T; while(T--) { int a,b,c; int count=0; cin>>a>>b>>c; memset(hash,0,sizeof(hash)); for(int x=1;x<=1000000;x++) { int sum=0; sum=c-a*x; if(sum<0) break; if(sum>1000000) break; hash[sum]++; } for(int y=1;y<=1000000;y++) { int sum=0; sum=b*y; if(sum>1000000) break; if(hash[sum]) count++; } cout<<count<<endl; } return 0;}
0 1
- HDU4993 Revenge of ex-Euclid(hash)
- HDU4993 Revenge of ex-Euclid
- HDU - 4993 Revenge of ex-Euclid
- HDU 4993 Revenge of ex-Euclid
- hdu 4993 Revenge of ex-Euclid(水题)
- HDU 4993Revenge of ex-Euclid(暴力)
- hdu 4993 Revenge of ex-Euclid(水题)
- HDU 4993 Revenge of ex-Euclid(数学题 暴力)
- hdu 4993 Revenge of ex-Euclid(水题)
- HDU 4993 / BC 9A Revenge of ex-Euclid
- 【CUGBACM15级BC第9场 A】hdu 4993 Revenge of ex-Euclid
- HDU4994 Revenge of Nim
- HDU4099 Revenge of Fibonacci
- 12333 - Revenge of Fibonacci
- UVa12333 - Revenge of Fibonacci
- Revenge of Fibonacc
- UVA12333--Revenge of Fibonacci
- hdu3522 ex-kmp或hash(暂时不理解
- ANDROID内存优化(大汇总——全)
- android JUnit单元测试
- 你安装的app应用是否对你的隐私进行了保护
- C语言Lesson4
- 电脑待机,休眠设置和使用(转)
- HDU4993 Revenge of ex-Euclid(hash)
- Ubuntu配置vim支持Python编程
- hdu 4994 Revenge of Nim (博弈)
- <<Python基础教程>>学习笔记 | 第02章 | 列表和数组
- 制成 ubuntu Server 的 U盘启动盘的方法
- android 之摄像头
- 我的五大开仓点与五大平仓点 开仓点
- 双边滤波
- egit教程