![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
CbdFocus
耐心是美德。
展开
-
hdu 2734 quicksum //简单校验算法
#include"iostream" #include"stdio.h" #include"algorithm" #include"string.h" using namespace std; int val(char a) { if(a==' ') return 0; return a-'A'+1; } int main() { char s[1000]; int i,sum; while(原创 2013-06-13 15:34:21 · 367 阅读 · 0 评论 -
poj 3006 Dirichlet&#03…
#include #include #include using namespace std ; bool isprime ( __int64 x ) { if ( x == 1 ) return false ; for ( __int64 i = 2 ; i <= (__int64)sqrt(x*1.0) ; i ++ ) if ( x % i == 0 )原创 2013-06-13 15:34:25 · 342 阅读 · 0 评论 -
poj 2739 sum of&n…
#include #include using namespace std; const int Max=1229; int a[Max]; int isprime(int x) { if(x==1) return 0; if(x==2) return 1; if(x%2==0) return 0; int i; for(i=3;i if(x%i==0)原创 2013-06-13 15:34:08 · 356 阅读 · 0 评论 -
hdu 1197 Specialized …
#include"iostream" #include"stdio.h" #include"algorithm" using namespace std; int getsum(int k,int quan) { int sum=0,a[5]; for(int i=4;i>0;i--) { a[i]=k%quan; k/=quan; sum+=a[i]; } return sum; } int m原创 2013-06-13 15:34:18 · 331 阅读 · 0 评论 -
poj 3299 humidex
#include //H=T+h(D) #include #include using namespace std; int main() { double one, two; char first, second; cout << setprecision ( 1 ) << fixed; while ( cin >>原创 2013-06-13 15:34:16 · 338 阅读 · 0 评论 -
hdu 1023 火车出入站,卡特兰数
http://www.cnblogs.com/kuangbin/archive/2012/03/21/2410516.html //h( n ) = ( ( 4*n-2 )/( n+1 )*h( n-1 ) ); #include<stdio.h>//******************************* //打表卡特兰数 //第 n个 卡特兰数存在a[n]中,a[n][0]表示长度; //转载 2015-04-05 15:10:22 · 276 阅读 · 0 评论