poj 3399 Product(数学)】的更多相关文章

主题链接:http://poj.org/problem?id=3399 Product Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2837   Accepted: 686   Special Judge Description There is an array of N integer numbers in the interval from -30000 to 30000. The task is to sele…
筛选法+求一个整数的分解+快速模幂运算+递归求计算1+p+p^2+````+p^nPOJ 1845 Sumdiv求A^B的所有约数之和%9901 */#include<stdio.h>#include<math.h>#include<iostream>#include<algorithm>#include<string.h>using namespace std;#define MOD 9901const int MAXN=10000;int p…
http://poj.org/problem?id=1190 题解:四个剪枝. #define _CRT_SECURE_NO_WARNINGS #include<cstring> #include<cctype> #include<cstdlib> #include<cmath> #include<cstdio> #include<string> #include<stack> #include<ctime>…
http://poj.org/problem?id=2002 只能说hash比二分快很多.随便一个hash函数都可以完爆二分. 判断是否存在正方形思路如下: 1.枚举任意两个点,作为正方形的一条边,那么,整个正方形就确定了,有两个方向. 因为, 设枚举的坐标为(x1, y1) & (x2, y2),所求的坐标是和x1,y1这个点相连,那么有方程如下. 1.垂直,向量积是0 2.边长相等,然后距离公式化简. 即可解出剩下的两个点. 然后要注意两个点要在正方形的同一侧,不然变了平行四边形了. 唤醒了…
The area Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6524    Accepted Submission(s): 4578题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1071 Problem Description Ignatius bought a land last w…
The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the question of primality. A prime number is a number that is has no prop…
Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 103896   Accepted: 50542 Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're a…
题目大意 给定你三个变量中的两个输出剩下的那一个 题解 没有什么,就是把公式推出来即可,完全的数学题 代码 #include <iostream> #include <cmath> #include <cstdio> using namespace std; int main() { /*ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);*/ char c; while(cin>>c) { double t=1…
题目大意 在二维坐标内选定一个点,问你当洪水以半圆形扩散且每年扩散50单位,哪一年这个点被被洪水侵蚀? 解法 代码 #include <iostream> #include <cstdio> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t,cnt=0; double pi=3.14; cin>>t; while(t--) { double…
OJ上的一些水题(可用来练手和增加自信) (POJ 3299,POJ 2159,POJ 2739,POJ 1083,POJ 2262,POJ 1503,POJ 3006,POJ 2255,POJ 3094) 初期: 一.基本算法: 枚举. (POJ 1753,POJ 2965) 贪心(POJ 1328,POJ 2109,POJ 2586) 递归和分治法. 递推. 构造法.(POJ 3295) 模拟法.(POJ 1068,POJ 2632,POJ 1573,POJ 2993,POJ 2996) 二…