自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

bo-jwolf的专栏

不求最强,但求无悔!!!

  • 博客(39)
  • 资源 (1)
  • 收藏
  • 关注

原创 hdu1194-Beat the Spread!

http://acm.hdu.edu.cn/showproblem.php?pid=1194理解题意#include#include#includeusing namespace std ;int main(){ int Case ; int m , n; int a , b ; cin >> Case ; while( Case-- ) {

2013-06-14 20:04:22 1180

原创 hdu1128-Self Numbers

http://acm.hdu.edu.cn/showproblem.php?pid=1128题意为找出从1开始的所有自私数,自私数满足,对于所有数据本身加上各个数位上和不会等于的数,就称为自私数#include#include#include using namespace std ;#define MAX 1000005int num[ MAX ] ;int judge

2013-06-14 18:45:10 1349

原创 hdu1195-Open the Lock

http://acm.hdu.edu.cn/showproblem.php?pid=1195dfs暴力搜索#include#include#include#include#includeusing namespace std ;struct node{ int num[ 4 ] ; int step ;};int visit[ 11 ][ 11 ][ 11 ][

2013-06-14 18:03:01 1015

原创 hdu1174-爆头

http://acm.hdu.edu.cn/showproblem.php?pid=1174之前没搞懂,想得太复杂了,从网上查了很多代码,但是很混乱,各种方法都有,不过,最终还是理清楚了 ;其中,就被高数中点向法,还有其他几种解法造成的误解最大;不过,最终又是在斌神的博客中找到了较好的方法http://www.cnblogs.com/kuangbin/archive/2011/08/12/

2013-06-09 22:27:46 1144

原创 hdu1098-Ignatius's puzzle

http://acm.hdu.edu.cn/showproblem.php?pid=1098#include#include#includeusing namespace std;int main(){ int k ; while( scanf( "%d" , &k ) != EOF ) { if( k % 65 == 0 ) { printf( "no\

2013-06-09 20:01:45 985

原创 hdu2060-Snooker

http://acm.hdu.edu.cn/showproblem.php?pid=2060题意为,给你场上剩下的球数m , 和 a ,b 两名队员目前得分,现在假设a将所有的球m都打入洞中,然后让你输出是否最终a的得分会超过b;              总共有15个红球,和6个有颜色的球,每个红球的得分为1 ,6个有颜色的球分别为2 , 3, 4 ,5, 6, 7 ;

2013-06-09 18:16:07 1108

原创 hdu1061-Rightmost Digit(附20循环的规律解法和附快速幂简单原理)

http://acm.hdu.edu.cn/showproblem.php?pid=10611.快速幂实现a^N求3^999(a=3,N=999):3 ^ 999 = 3 * 3 * 3 * … * 3,直接乘要做998次乘法。快速幂方法实质使用了二分法进行时间优化: tmp+   =   tmp-*    a-;3 ^ 1  =    3*    13 ^ 2  = (3

2013-06-09 15:45:21 2504 7

原创 hdu1060-Leftmost Digit

http://acm.hdu.edu.cn/showproblem.php?pid=1060#include#include#includeusing namespace std ;int main(){ double temp ; int Case , n ; __int64 ans ; cin >> Case ; { while( Case-- ) {

2013-06-09 14:35:18 906

原创 hdu1081-To The Max

http://acm.hdu.edu.cn/showproblem.php?pid=1081DP,最大矩阵和,首先将横坐标的数值,分别求和存储在二维数组中,然后使用三个for循环,第一二层分别表示第I 横层 ,和第j 横层,然后做差,就求出了纵坐标的和,当sum〉0就由k 向右累加;#include#include#includeusing namespace std ;int

2013-06-09 14:33:41 1256

原创 hdu2074-叠筐

http://acm.hdu.edu.cn/showproblem.php?pid=2074#include#include#includeusing namespace std;char mapp[ 100 ][ 100 ] ;char a[ 10 ][ 10 ] ;void dfs( int x , int y , int k ){ if( x > y ) retu

2013-06-08 22:42:46 971

原创 hdu3787-A+B

http://acm.hdu.edu.cn/showproblem.php?pid=3787#include#include#includeusing namespace std ;char a[ 1005 ] , b[ 1005 ] , aa , bb ;int c[ 1005 ] , d[ 1005 ] , e[ 1005 ];int main(){ int i ,

2013-06-08 21:37:35 836

原创 hdu1230-火星A+B

http://acm.hdu.edu.cn/showproblem.php?pid=1230#include#include#include#includeusing namespace std ;int prime[ 30 ] ;int num[ 30 ];void Prime(){ memset( num , 0 , sizeof( num ) ); int i

2013-06-08 20:10:09 837

原创 hdu3117-Fibonacci Numbers

http://acm.hdu.edu.cn/showproblem.php?pid=3117后四位存在周期15000,所以就打表打出了后四位的值。前四位按照Fibonacci的通项公式取前四位即可#include#include#include#includeusing namespace std;int fi[ 100 ] = { 0 , 1 , 1 } ;int L

2013-06-08 18:58:02 741

原创 hdu1250-Hat's Fibonacci

http://acm.hdu.edu.cn/showproblem.php?pid=1250二维大数处理#include#include#include#includeusing namespace std ;#define maxm 10005#define maxn 305 int fi[ maxm ][ maxn ] ;void Add(){ memset(

2013-06-08 16:51:11 1084

原创 hdu1568-Fibonacci

http://acm.hdu.edu.cn/showproblem.php?pid=1568用到了斐波那契数列的通项公式。先看对数的性质,loga(b^c)=c*loga(b),loga(b*c)=loga(b)+loga(c);假设给出一个数10234432,那么log10(10234432)=log10(1.0234432*10^7)=log10(1.0234432)+7;

2013-06-08 16:08:38 1042

原创 hdu2824-The Euler function

http://acm.hdu.edu.cn/showproblem.php?pid=2824#include#include#includeusing namespace std; #define maxn 3000010#define INT __int64 int Prime[ maxn + 1 ] ;INT ans[ maxn + 1 ] ;void enlerfu

2013-06-08 14:43:34 896

原创 hdu4556-Stern-Brocot Tree

http://acm.hdu.edu.cn/showproblem.php?pid=4556#include#include#includeusing namespace std ;#define maxn 1000005#define INT __int64INT ans[ maxn + 1] ;void enlerfun(){ memset( ans , 0 , si

2013-06-08 14:42:01 1069

原创 hdu3501-Calculation 2

http://acm.hdu.edu.cn/showproblem.php?pid=3501这题参考了别人的代码,才知道原来当数据较大时求解前n 项的欧拉函数和,可以直接利用 n * enlerfun( n) / 2求解,而此题要求的是非互质的,同样可以使用这个性质#include#include#includeusing namespace std ;#define MOD

2013-06-08 14:07:42 1113

原创 hdu1787-GCD Again

http://acm.hdu.edu.cn/showproblem.php?pid=1787非数组形式,用于大数据#include#include#include#includeusing namespace std ;#define INT __int64int enlerfun( int n ){ int tempnum = 1 ; int i ; for( i

2013-06-08 13:31:50 911

原创 hdu1286-找新朋友

http://acm.hdu.edu.cn/showproblem.php?pid=1286本来可以直接用普通的欧拉函数,但是,这个那样非常容易TLE,所以用素数筛法+欧拉函数;#include#include#include#includeusing namespace std ;#define maxn 100005int prime[ maxn + 1 ] ;int

2013-06-07 22:01:44 807

原创 poj3090-Visible Lattice Points

http://poj.org/problem?id=3090法雷级数,,欧拉函数#include#include#includeusing namespace std; #define maxn 1000005 #define INT __int64 int Prime[ maxn + 1 ] ;INT ans[ maxn + 1 ] ;void prime()

2013-06-07 18:43:11 1074

原创 poj2478-Farey Sequence

http://poj.org/problem?id=2478素数筛法+欧拉函数#include#include#includeusing namespace std; #define maxn 1000005 #define INT __int64 int Prime[ maxn + 1 ] ;INT ans[ maxn + 1 ] ;void prime(){

2013-06-07 14:46:21 1026

原创 poj2407-Relatives

http://poj.org/problem?id=2407欧拉函数#include#include#include#includeusing namespace std ;#define INT __int64int enlerfun( INT n ){ int tempnum = n ; for( int i = 2 ; i <= n ; ++i ) {

2013-06-07 14:15:12 1361

原创 hdu1049-Climbing Worm

http://acm.hdu.edu.cn/showproblem.php?pid=1049#include#includeusing namespace std; int main(){ int high , up , down ; while( cin >> high >> up >> down ) { if( high == 0 && up == 0 && down

2013-06-06 22:34:24 905

原创 hdu1034-Candy Sharing Game

http://acm.hdu.edu.cn/showproblem.php?pid=1034#include#includeusing namespace std;#define MAX 10010 int number[ MAX ] ;int main(){ int n ; int i ; while(cin >>n && n ) { for( i = 0 ;

2013-06-06 20:44:40 985

原创 hdu1163-Eddy's digital Roots

http://acm.hdu.edu.cn/showproblem.php?pid=1163这道题目本来没有看到 n ^ n ,所以直接写,TLE了,但是突发奇想,能不能在n 累乘的过程中,直接求出各位数值和,在继续乘以 n ,直到 乘了n次;但是没有搞懂原理,后来问了dogdog,才知道了原理;假设 前两位大于10 相乘为ab(因为有一项满足,其余的肯定也能通过同一个原理证明出来);利用

2013-06-06 14:58:54 759

原创 poj2262-Goldbach's Conjecture

http://poj.org/problem?id=2262#include#include#include#include#include#includeusing namespace std ;#define INT long long INT judge( INT n ){ if( n % 2 == 0 ) return 0 ; else { for(

2013-06-06 13:31:33 1039

原创 ubuntu下txt乱码解决方法

txt双击默认gedit打开,修改gedit自动检测编码的顺序,就可以搞定中文乱码的问题,命令如下gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-8', 'GB18030', 'GB2312', 'GBK', 'BIG5', 'CURRENT', 'UTF-16']"

2013-06-06 12:49:53 975

原创 hdu1165-Eddy's research II

http://acm.hdu.edu.cn/showproblem.php?pid=1165#include#include#include#include#includeusing namespace std ;#define INT __int64INT dfs( INT m , INT n ){ if( n == 0 ) dfs( m -

2013-06-06 12:45:19 966

原创 hdu1164-Eddy's research I

http://acm.hdu.edu.cn/showproblem.php?pid=1164题目比较水,但是还是发现一些小问题 ;细节。。注重细节#include#include#include#include#includeusing namespace std ;#define INT __int64bool judge( INT n ){ for( INT i

2013-06-06 11:01:30 1200

原创 hdu1162-Eddy's picture

http://acm.hdu.edu.cn/showproblem.php?pid=1162#include#include#include#include#includeusing namespace std; #define MAX 5050int fa[ MAX ] ;struct node{ int x , y ; double value ; bool

2013-06-06 10:39:48 896

原创 hdu1162-Eddy's picture

http://acm.hdu.edu.cn/showproblem.php?pid=1162#include#include#include#include#includeusing namespace std; #define MAX 5050int fa[ MAX ] ;struct node{ int x , y ; double value ; bool o

2013-06-06 10:38:14 770

原创 hdu4180-RealPhobia

http://acm.hdu.edu.cn/showproblem.php?pid=4180题意为给定一个数(a/b),求另一个(c/d) ,要求d  当 a 与 b 互质的时候 ,有a * d + 1 == b * c  || a * d == b * c +  1 ;  然后通过exgcd 求出c 和 d 然后比较d的大小,最后输出结果;需要注意的是,这只是其中的一种情况, 当a

2013-06-05 22:23:37 1446

原创 hdu1222-Wolf and Rabbit

http://acm.hdu.edu.cn/showproblem.php?pid=1222将环转换成首尾相接无限延长的直线...........1,2,3,4........n , 1, 2, 3, 4,.....n ,1, 2, 3 , 4,..........如果需要找到兔子,就以为着需要遍历所有的山洞,而且每一次所到达的山洞的位置,不能是相同的,否则,就会产生“死”循环。假设

2013-06-05 21:17:12 1204

原创 Problem 1165 - Smith Number

http://acm.whu.edu.cn/land/problem/detail?problem_id=1165#include#includeusing namespace std ;#define INT long long INT Sum( INT x ){ INT sum = 0 ; while( x ) { sum += x % 10 ; x /=

2013-06-05 20:06:06 2255

原创 hdu1333/poj1142-Smith Numbers

http://poj.org/problem?id=1142http://acm.hdu.edu.cn/showproblem.php?pid=1333#include#include#include#include#includeusing namespace std;int Sum( int x ){ int sum = 0 ; while( x ) {

2013-06-05 19:46:57 1180

原创 hdu2669-Romantic

http://acm.hdu.edu.cn/showproblem.php?pid=2669#include#include#include#include#includeusing namespace std ;#define INT __int64 INT x , y , c , d ;INT a , b ;INT exgcd( INT a ,INT b , IN

2013-06-04 22:12:51 1387

原创 hdu1576-A/B

http://acm.hdu.edu.cn/showproblem.php?pid=15761、了解扩展欧几里德算法,可以运用其解出gcd(a,b)=ax1+by1中的x1、y1的值2、由题可得以下内容:n=A%9973,则n=A-A/9973*9973。又A/B=x,则A=Bx。所以Bx-A/9973*9973=n。即Bx-9973y=n。到这里我们可以发现:

2013-06-04 21:32:14 1059

原创 poj1061-青蛙的约会

http://poj.org/problem?id=1061原理参照扩展欧几里得算法#include#include#include#include#include#define LL long long using namespace std; LL int x , y , m , n , l ;LL xx , yy , mm , nn , ll , c , d ;L

2013-06-04 20:23:40 931

2013年蓝桥杯辅导资料

2013年蓝桥杯内部购买资料,包括参考例题上面均有

2013-04-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除