自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

施工中请绕行

没有什么事情是做不成的,只要你真的想做

  • 博客(35)
  • 资源 (6)
  • 收藏
  • 关注

原创 poj2407解题报告

RelativesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6232 Accepted: 2786DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no intege

2010-08-27 07:46:00 967

原创 poj2377解题报告

Bad CowtractorsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6456 Accepted: 2816<br />DescriptionBessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has a

2010-08-25 14:25:00 1131

原创 poj2421解题报告

Constructing RoadsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 12166 Accepted: 4831<br />DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. W

2010-08-17 06:38:00 1269

原创 poj3083解题报告

Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4046 Accepted: 1838DescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wie

2010-08-16 08:05:00 1999

原创 poj2780解题报告

LinearityTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 5999 Accepted: 1287DescriptionAlice often examines star maps where stars are represented by points in a plane and there is a Cartesian coordinate for each star. Let the Linearity of a star

2010-08-15 07:47:00 988

原创 poj2756解题报告

Autumn is a GeniusTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6040 Accepted: 1269<br />DescriptionJiajia and Wind have a very cute daughter called Autumn. She is so clever that she can do integer additions when she was just 2 years old! Since

2010-08-14 19:09:00 1353

原创 poj2406解题报告

Power StringsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 13765 Accepted: 5738<br />DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of conca

2010-08-14 08:57:00 1427

原创 poj2498解题报告

StuPIdTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 5111 Accepted: 2631<br />DescriptionBackground<br />At DUT, the Dreamland University of Technology, all students have personal id, numbers with six or seven digits. But they're not just any nu

2010-08-13 19:56:00 1503

原创 分解质因数算法

<br /> <br />#include<stdio.h>#include<math.h>int main(){ int n,i; while(scanf("%d",&n)&&n) { for(i=2;i<=sqrt(n);i++) if(n%i==0&&(n/=i)) printf("%d ",i--); printf("%d/n",n); } r

2010-08-13 14:05:00 8066 4

原创 恶搞程序

以前写的,网上有一个叫“我是猪”的程序,运行了就倒计时60秒关机,输入“我是猪才能解除倒计时”,那个程序用到了shutdown 命令,倒计时时打开cmd 输入shutdown -a就能解除,我在这个基础上又加了点功能,让这个程序更猥琐,倒计时时修改注册表暂时禁用cmd,不能通过cmd解除状态。。比如输入指定的字符串才能解除。并且扫描输入的字符串如果发现骂人的关键词就立马关机。。。(XP下的)禁用cmd的注册表位置在HKEY_CURRENT_USER/Software/Policies/Microsoft/W

2010-08-13 10:11:00 7854 2

原创 以前写的小游戏

两人对战的五子棋,上下左右为wsad  回车为下棋。。。#include#includeusing namespace std;struct mov{ int x,y;}mov[8]={-1,-1,-1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1};int map[20][20],step,X,Y;int dfs(int x,int y,int fang,int jige,int type){ if(x+mov[fang].x>=0&&x+mov[fan

2010-08-13 09:37:00 1040

原创 poj1258解题报告

Agri-NetTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15626 Accepted: 6327<br />DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your h

2010-08-13 09:23:00 3150 1

原创 poj1426解题报告

<br />DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corresponding m containing no mor

2010-08-12 19:31:00 1091

原创 poj1088解题报告

DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9一个人可以从某个点滑向上下左右相邻四个点之一,当且仅当高度减小。在上面的例子

2010-08-12 09:44:00 1460

原创 poj1573解题报告

<br />题目大意:给定一个由SNWE几个字母组成的地图,这四个字母代表着四个方向,给定起点,让你判断是否能走出这个地图,或走到某步的时候形成一个环。。。<br /><br />Sample Input3 6 5NEESWEWWWESSSNWWWW4 5 1SESWEEESNWNWEENEWSEN0 0 0<br />Sample Output10 step(s) to exit3 step(s) before a loop of 8 step(s)<br />

2010-08-11 20:37:00 1277

原创 poj1101解题报告

<br />题目大意:以连连看为原型的题目,给定地图和地图上两点,求从第一个点到第二个点最少需要转几次弯。。。<br /><br /> <br />思路:还是走迷宫的变种,将转1.2.3......n次能到达的点都入队,求出最少的转弯次数<br /> <br /> <br /> <br />#include<iostream>using namespace std;struct mov{ int x,y;}mov[4]={1,0,-1,0,0,1,0,-1};char map[80]

2010-08-11 20:36:00 2277

原创 poj2312解题报告

<br />第三个BFS<br />题目大意:这个题是以坦克大战为原型出来的题目,就是走迷宫的变种,给定一个地图mxn的地图,地图上有普通的砖B,金砖S,河R,和一个宝物位置T,和你的位置Y,求吃到宝物的最小步数(坦克通过普通砖需要两步,不能通过金砖和河)...<br /><br /> <br />Sample Input3 4YBEBEERESSTE0 0<br />Sample Output8<br /> <br />思路:走迷宫的思路,加点变化,在将横纵坐标步数入队的同时在将sta

2010-08-11 20:34:00 970

原创 poj3126解题报告

<br />我的第二道BFS题<br />题目大意:给定两个4位的质数a和b,从a开始每次只能改变a的一个数字,并且改完后的a还是质数,求a最少经过几次变换能得到b.....<br /> 比如1033变到8179最少需要6次,过程如下<br />1033<br />1733<br />3733<br />3739<br />3779<br />8779<br />8179<br /> <br /> <br />解题思路:典型BFS<br /> <br />#include<iostream>#inclu

2010-08-11 20:33:00 2214 1

原创 poj2251解题报告

<br />给定一个3D迷宫判断走出去的最小步数....<br />Sample Input3 4 5S.....###..##..###.#############.####...###########.#######E1 3 3S###E####0 0 0<br />Sample OutputEscaped in 11 minute(s).Trapped!<br /> <br />我的首个BFS题,感谢小杰的

2010-08-11 20:31:00 839

原创 poj2245解题报告

<br />题目大意:给定一个递增的序列,输出在这个序列中的6个元素的递增全排列。。。<br /> <br /> <br />#include<iostream>using namespace std;int num[20],n;void find(int i,int finded,int shows[]){ int show[7],j; for(j=1;j<7;j++) show[j]=shows[j]; show[finded]=i-1; if(finded=

2010-08-11 20:27:00 717

原创 poj1159解题报告

<br />题目大意:给定一个字符串,让你在这个串中加入最少的字符,使其成为回文串,(回文串就是正着读和反着读一样的串)比如:"Ab3bd"加入最少加入两个字符才能成为回文串"dAb3bAd"或者 "Adb3bdA"。。。。求最少添多少个字符。。。<br /> <br />思路:假设长度为len的字符串存在str[ ]里,初始left=0,right=len-1,如果str[left]不等于str[right]那么则有find(letf,right)=min(find(left,rght-1),find(l

2010-08-11 20:25:00 725

原创 poj1102解题报告

<br />题目大意:给定字体大小,和一个数,将这个数按给定的字体大小显示出来。。。。<br />Sample Input2 123453 678900 0<br />Sample Output -- -- -- | | | | | | | | | | | | -- -- -- -- | | | | | | | | | |

2010-08-11 20:22:00 1125

原创 poj2533解题报告

<br />题意:求一个序列中最长上升子序列<br />Sample Input<br />7<br />1 7 3 5 9 4 8<br />Sample Output4思路:以第i位元素开始的最长上升子序列长度等于1加上i+1~n中的某个j位的最长上升子序列(a[i]<a[j]),然后递归求解#include<iostream>using namespace std;int n,a[1010],maxl[1010];void find(int i){ int j,flag=0;

2010-08-11 20:19:00 1033

原创 poj2528

<br />以前写的,纯暴力,提交TLE,今天突然闲着无聊,不报任何希望的交一遍玩玩居然1000MS过了,靠~~再连着交两边。。TLE。。再交一遍985MS,,汗。。rp大爆发<br /> <br /> <br />#include<iostream>using namespace std;int main(){ int ca[30010][3],cal[10010],duo[30010],t,n,k,flag,i,j,o,nn,s; cin>>t; while(t--) {

2010-08-11 20:18:00 612

原创 poj1306解题报告

题目大意:求C(m)(n),输出结果的二进制不超过32位。。思路:先将1~100的素数打表,然后把每个分子分母分解质因数,记录下分子因数分解的情况,分子质因数表加到一起,分母的表加到一起,最后把分子的质因数表减去分母的质因数表,然后结果就好球了。。#include<iostream>#include<cmath>using namespace std;int prime[50];void find(){ prime[0]=2; int i,j=1,n=3; while(j

2010-08-11 20:16:00 984

原创 poj1844解题报告

<br />题目大姨:一个数T可以由1 2 3 4 .......N来表示,其中两数之间或是加号或是减号。。。比如<br />12 = -1+2+3+4+5+6-7,,,,12最小可由1~7这7个数以上述规则得到,现在给定一个T,求按照上述规则可以表示T的最小N。。。。。<br />Sample Input12<br />Sample Output7思路:假设符号都为正,那么表示T的最小N是sqrt(2T),但是如果这里面有负号,不妨设所有负项的和为s,那么就有(N+1)*N/2-2*S=T,由此可以得到(

2010-08-11 20:14:00 1356

原创 poj1019解题报告

<br />题目大姨:求下列序列中第i位是多少。。。序列如下<br />11212312341234512345612345671234567812345678912345678910123456789101112345678910。。。。。<br />这个序列规律就是1   12   123   1234   12345 .........123456789   12345678910 ......<br /> <br />思路:定义一个数组,记录每个数的长度,然后求num[1]+......+num[k

2010-08-11 20:13:00 923

原创 poj1316解题报告

<br />题目大姨:开始给出了一个"自私数"的定义,这个定义是什么呢?如果一个数不能分解为另一个数和那个数各位数字之和,它就是一个"自私数",举个例子,比如87可以分解为75+7+5,所以87就不是"自私数".....这道题要输出1~10000以内的"自私数"。。。。<br /> <br />思路:利用一个数和这个数各个数字之和除9同余,假设t是"自私数",设它可以被n分解,n的各位和是s,那么就有t%9=(n%9+s%9)%9,如果t%9为奇数,那么(t%9+9)/2就等于s%9和n%9,否则t%9等于

2010-08-11 20:11:00 2607 2

原创 poj2182解题报告

<br />题目大姨:n头牛排队,给定从2~n头牛每头牛前面比它号码小的牛的头数,确定这队牛的排队方式<br /> <br />Sample Input51210<br />Sample Output24531思路:从第n头牛开始,如果假设该头牛前面有k头牛比它的编号小,那么如果不考率重复,那么这头牛编号应该是k+1,但这1~k号的牛可能在第n头牛确定号码之前就已经被确定了,所以开一个数组lock[8010]记录在确定第n头牛之前确定的牛的编号,每当k+1小于lock

2010-08-11 20:10:00 1892 1

原创 poj1579解题报告

<br />题目大姨:给出一个递归法则,求出给定变量a,b,c经过该递归后的值..法则如下<br /> <br />Consider a three-parameter recursive function w(a, b, c): <br />if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns: <br />1 <br />if a > 20 or b > 20 or c > 20, then w(a, b, c) returns: <br />w(

2010-08-11 20:08:00 1010

原创 poj1504解题报告

<br />题目大姨:给定n组数据,每组数据包含两个数a和b,求将a反转加上b反转然后整个再反转的值。。水题。。<br /> <br />#include<iostream>using namespace std;int fan(int n){ long int sum=0; while(n!=0) { sum=sum*10+n%10; n/=10; } return sum;}int main(){ int t,a,b; cin>>t;

2010-08-11 20:06:00 1615

原创 poj1118解题报告

<br />题目大意是这样:给出n个点的坐标,判断在这些点中最多有多少个点共线。。。思路是这样,将1~n的每一个点作为原点,将其他点的坐标变换到以这个店为原点的坐标系上来并求出斜率排序,最后判断有有多少点共线,取出最多输出。。。按这个思路写的代码跑了282MS。。。<br /> <br /> <br />#include<iostream>#include<algorithm>#include<stdio.h>using namespace std;int main(){ int n

2010-08-11 20:05:00 1298 1

原创 poj1906解题报告

<br />题目大意:   求3的k次幂集合{1.3.9.27.81......}中和排在第n位的子集,从小到大输出.....<br /> <br /> <br />Sample Input17147831125900981634049<br />Sample Output{ }{ 3, 9 }{ 1, 9, 27 }{ 3, 9, 27, 6561, 19683 }{ 59049, 3486784401, 205891132094649, 71789798769185258

2010-08-11 20:02:00 1118

原创 poj3660解题报告

题目大意:n头牛比赛 共比了t场,给出每场比赛的结果,求出可以确定名次的牛的头数比如n=3 t=2  每场比赛的结果是 3 win 1 3 win 2 那么程序应该输出1(3号肯定是第一了)......以前没做过这类题,刚开始没思路,想了一会想到可以用开两个数组high[110][110]和low[110][110]来记录赢了第i头牛和输给第i头牛的牛的编号,输入完毕后对每头牛深搜,定义一个数组num[110][110]初始化为0,将深搜中搜到比第i头牛强或弱的j,将num[i][j]置为1,最后判断num

2010-08-11 19:55:00 1220

原创 人机对战五子棋

人机对战五子棋,BOT的AI不太高,大约是初级的中等水平,,,等有时间再提升下BOT AI。。。。#include#includeusing namespace std;struct mov{ int x,y;}mov[8]={-1,-1,-1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1};class chessmap{ int X,Y,lastX,lastY,step;public: friend class checker;

2010-08-01 09:57:00 2225 4

安卓加载so卡死问题复现

某些低版本智能电视盒子系统上,APP调用System.loadLibrary会导致卡死的现象,经过定位为gnustl的问题,该示例可以稳定复现出问题

2018-04-14

protobuf iOS静态库

iOS 编译protobuf 2.6.1静态库

2016-03-01

类Lex & Yacc

笔者实现了一个类似于Lex & Yacc的编译器前端构造工具,该工具基于LALR(1)分析法,支持二义性文法,支持语法制导翻译,支持错误恢复机制,使用它我们可以构造指定词法文法的编译器前端,并且构造的分析器是线程安全的。里面还给出几个示例,构造四则表达式计算器,JSON解析器和C99标准C编译器前端。 编译原理课程的大杀器

2014-09-25

NeHe的OpenGL教程

OpenGL的经典入门教程,对新手很有帮助~~~~

2011-08-04

课程设计表达式计算器--递归实现

用递归实现的表达式计算器,课程设计时写的,支持分数,对表达式求精确值(由于小数可以用分数表示,因此不支持小数)

2011-01-24

控制台下C俄罗斯方块

VC++6.0下编译通过,变型落地消行有音效...

2010-10-08

空空如也

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

TA关注的人

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