poj 1840 (数学)
来源:互联网 发布:淘宝首页添加链接代码 编辑:程序博客网 时间:2024/04/30 05:42
点击打开链接
政府对称,注意0的情况。。。
#include<stdio.h>#include<string.h>short mark1[25000001];int main(){int a[105];int b[5];int i,j;j=0;int temp;for(i=-50;i<=50;i++){if(i==0)continue;a[j]=i*i*i;j++;}while(scanf("%d%d%d%d%d",&b[0],&b[1],&b[2],&b[3],&b[4])!=EOF){ memset(mark1,0,sizeof(mark1));//memset(mark2,0,sizeof(mark2));int q,w,e,r,t,i,j;for(i=0;i<100;i++){for(j=0;j<100;j++){if(!a[j])continue; temp=a[i]*b[3]+a[j]*b[4];if(temp<0)temp+=25000000; mark1[temp]++;//else mark2[temp]++;}}__int64 ans=0;int temp;for(q=0;q<100;q++){for(w=0;w<100;w++)for(e=0;e<100;e++){temp=b[0]*a[q]+b[1]*a[w]+b[2]*a[e];if(temp<0){temp+=25000000;//ans+=mark2[temp];}//else ans+=mark1[temp];}}printf("%I64d\n",ans);}return 0;}
- poj 1840 (数学)
- POJ 1840(哈希,数学,思维)
- POJ 1840 数学
- POJ 1840 - Eqs(数学)
- POJ数学(ZZ)
- POJ 2853 (数学)
- POJ 2140(数学问题)
- POJ 3737 UmBasketella (数学)
- poj 3196(水数学)
- POJ 1844 Sum(数学)
- POJ数学题目(转载)
- poj 1809 Regetni(数学)
- POJ 1715(组合数学)
- POJ 3101 Astronomy (数学)
- poj 数学
- POJ——2249(组合数学)
- zoj 2185||poj 1969||(数学)
- poj——1019(数学)
- android ListView根据字母排序和定位
- 网络编程 套接字类CAsyncSocket的用法
- 简化开发-base类(泛型)
- WATCH YOUR NOVA LOG AT THE SAME TIME
- 【又是忠告】一位年轻女董事长的37条忠告
- poj 1840 (数学)
- 关于HttpClient的总结
- 高质量编程之表达式和基本语句
- 专访邓凡平:Android开发路上的快速学习之道
- 投文章模板
- node.js npm ffi Could not locate the bindings file
- 在Android中对SD卡进行扇区级读写
- Android之用HTTP的get,post,HttpClient三种方式向service提交文本数据
- openerp开发案例