ubuntu 9.10 安装 Thinkpad SL410 无线网卡驱动
摘要:先下载驱动: 驱动下载地址:http://www.thinkwiki.org/wiki/ThinkPad_11b/g/n_Wireless_LAN_Mini-PCI_Express_Adapter_II 点进Linux driver链接 website 选择驱动8192se,然后download解压安装: $ tar -zxvf rtl8192se_linux_2.6.0010.1012...
阅读全文
posted @
2010-05-15 17:04
VRS
阅读(846)
推荐(1)
POJ 3299
摘要:#include<iostream>#include<cmath>using namespace std;char s[2][2];int main(){ int i; double h=0,t=0,d=0,temp,a[2]; while(cin>>s[0] && s[0][0]!='E') { cin>>a[0]>>...
阅读全文
posted @
2010-05-12 13:38
VRS
阅读(169)
推荐(0)
开博之感
摘要:本来这篇文章应该开博第一天就来写的,鉴于前两天一直忙,没时间来写写。 其实我开博客原因很简单,并非要吸引点击率(本来就不是什么名人),只是想作为自己的小地盘,把一些学习工作的资料统一管理,收藏别人的好文章,分享自己的一点体会,作为与其他技术人员交流的平台。 写文章本来就不是自己的长项,但我也不想在这个博客里吹水,希望尽可能保留好一点的博文,可能借鉴别人的比较多吧。
阅读全文
posted @
2010-05-12 13:34
VRS
阅读(116)
推荐(0)
(转)一份计算机读研的取向
摘要:1.读计算机研究生最好要有实际际开发经验 这里所说的“有实际开发工作经验”通常应该具备:1)你已经认为C++和汇编语言都是很简单的语言,并能够自如地运用; 2)你完全理解STL为什么这么重要;3)你能够在30分钟之内想到正确的五子棋AI算法设计思路和方向;4)你能够独立地解决所有的编译与链接问题,哪怕你从来没有遇到的问题,你也不需要询问任何人;5)英文网站是你的首要信息来源...
阅读全文
posted @
2010-05-12 13:23
VRS
阅读(240)
推荐(0)
虚拟机Ubuntu9.10下编译内核
摘要:我编译的是在Ubuntu9.10下编译 Linux-2.6.33内核(原来内核Linux-2.6.31.……)首先需要前期准备,由于Ubuntu没有相关的编译工具,所以应该先安装Vim,build-essential,ncurses-dev这几个工具前期准备:1. 安装编译器(这其实是一个开发工具包) sudo apt-get install build-essenti...
阅读全文
posted @
2010-05-12 13:16
VRS
阅读(2004)
推荐(2)
ZOJ 2970
摘要:#include<iostream>using namespace std;char s[100];int a[100000];int main(){ int i,n,num,valu; cin>>n; while(n--) { cin>>s; cin>>num; for(i=0;i<num;i++) cin>>a[i]; i...
阅读全文
posted @
2010-05-12 13:12
VRS
阅读(162)
推荐(0)
ZOJ 2797 最安全逃芝加哥路径
摘要://////////////////////////////////////////////////////////////最安全逃芝加哥路径//用单源最短路径法//在本题中的prev[]没有用到,这是用于构造最短路径的,本题不需要#include<iostream>#include<iomanip>using namespace std;#define MIN 0.0do...
阅读全文
posted @
2010-05-12 13:11
VRS
阅读(491)
推荐(0)
ZOJ 2807
摘要:#include<iostream>using namespace std;int main(){ int num; int n; cin>>n; while(n--) { cin>>num; int i; int sum=0; for(i=0;i<num;i++) { int temp; cin>>temp; sum+=temp; ...
阅读全文
posted @
2010-05-12 13:11
VRS
阅读(106)
推荐(0)
ZOJ 2812
摘要:#include<iostream>using namespace std;char st[1000];int main(){ while(cin.getline(st,990) && st[0]!='#') { int len=strlen(st); int i; long sum=0; for(i=0;i<len;i++) if(st[i]!=' ')...
阅读全文
posted @
2010-05-12 13:11
VRS
阅读(213)
推荐(0)
ZOJ 2781
摘要:#include<iostream>#include<math.h>using namespace std;int main(){ long n; cin>>n; while(n--) { long num; cin>>num; if(num<=10) cout<<num<<endl; else { long ...
阅读全文
posted @
2010-05-12 13:09
VRS
阅读(187)
推荐(0)
ZOJ 2782
摘要:#include<iostream>#include<string>using namespace std;struct Item{ char st[10]; bool flag;}from[25],to[25];void move(int sta_pos,int req_pos){ strcpy(to[req_pos].st,from[sta_pos].st); from...
阅读全文
posted @
2010-05-12 13:09
VRS
阅读(205)
推荐(0)
ZOJ 2417
摘要:#include<iostream.h>#include<math.h>//using namespace std;int main(){ int a,i,jishu; while(cin>>a && a!=0) { jishu=0; i=0; while(!i) { i=a%2; a/=2; if(i==0) jishu++; } ...
阅读全文
posted @
2010-05-12 13:08
VRS
阅读(144)
推荐(0)
ZOJ 2433
摘要:#include<iostream>using namespace std;long st[50000];int main(){ int casenum; cin>>casenum; while(casenum--) { int n; cin>>n; int i; st[1]=0; for(i=2;i<=n;i++) cin>>st[...
阅读全文
posted @
2010-05-12 13:08
VRS
阅读(156)
推荐(0)
ZOJ 2388
摘要:#include<iostream>using namespace std;int main(){ int casenum; cin>>casenum; while(casenum--) { int sum,dif; cin>>sum>>dif; if(sum<dif || 1==(sum-dif)%2) //当sum<dif或一奇...
阅读全文
posted @
2010-05-12 13:07
VRS
阅读(190)
推荐(0)
ZOJ 2405
摘要:#include<iostream>using namespace std;bool fun(int n){ int sum=0; int temp=n; while(temp!=0) { sum+=temp%10; temp/=10; } temp=n; int sum2=0; while(temp!=0) { sum2+=temp%12; temp/=12; } if(su...
阅读全文
posted @
2010-05-12 13:07
VRS
阅读(171)
推荐(0)
ZOJ 2376 小虫爬杆
摘要:#include<iostream>using namespace std;long st[1000000];int main(){ long casenum; cin>>casenum; while(casenum--) { long len,num; cin>>len>>num; long i; for(i=0;i<num;i++)...
阅读全文
posted @
2010-05-12 13:06
VRS
阅读(235)
推荐(0)
ZOJ 2321
摘要:#include<iostream>#include<string>using namespace std;struct MAN{ float sp; int a,b; char name[40];}man[3];int main(){ man[0].sp=4.5; man[0].a=150; man[0].b=200; strcpy(man[0].name,"Wide R...
阅读全文
posted @
2010-05-12 13:05
VRS
阅读(153)
推荐(0)
ZOJ 2345 国王金币数
摘要://2345国王金币数//思路:先找出allnum(allnum<=n)使allnum=1+2+3+…+k,同时算出k,则f(allnum)=∑i^2,// 而f(n)=f(allnum)+(n-allnum)*(k+1). 已知公式∑i^2=k*(k+1)*(2k+1)/6#include<iostream>#include<math.h&g...
阅读全文
posted @
2010-05-12 13:05
VRS
阅读(268)
推荐(0)
ZOJ 2351
摘要://关键是一条公式#include <iostream>#include <iomanip>#include <math.h>using namespace std;int main(){ int case_num; cin>>case_num; while(case_num--) { double ka,ori; //这里科学记录法可以作为输入 ...
阅读全文
posted @
2010-05-12 13:05
VRS
阅读(217)
推荐(0)
ZOJ 2202 α编码
摘要:///////////////////////////////////////////////////// 1677474 2008-10-25 14:46:52 Accepted 2202 C++ 0 192 VRS //计算编码后再译码的种数//利用分治法,把字符串s二分为s1和s2,再把两部分的种数相乘//注意情况:合并s1和s2时,考虑相邻接的两数可以组成一个编码,还有对0的多种情况的讨论...
阅读全文
posted @
2010-05-12 13:03
VRS
阅读(299)
推荐(0)
ZOJ 2176
摘要:#include<iostream>using namespace std;int main(){ int num; while(cin>>num && num!=-1) { int old,cur; int cost; int sum=0; old=0; while(num--) { cin>>cost>>cur; su...
阅读全文
posted @
2010-05-12 13:01
VRS
阅读(154)
推荐(0)
ZOJ 2108
摘要:#include <iostream>using namespace std;int main(){ long n; long old,cur; long sum; while(cin>>n && n!=0) { sum=n*5; old=0; while(n--) { cin>>cur; if(cur-old>0) sum+=(c...
阅读全文
posted @
2010-05-12 11:11
VRS
阅读(141)
推荐(0)
ZOJ 2136
摘要://////////////////////////////////////最长升序数//用贪心法#include<iostream>using namespace std;int a[1005];int st[1005][2];int main(){ int i,j,n,num,max,sta; cin>>n; while(n--) { cin>>num; ...
阅读全文
posted @
2010-05-12 11:11
VRS
阅读(224)
推荐(0)
ZOJ 2097 棋盘走路
摘要:#include<iostream>#include<queue>using namespace std;#define max 1001 //这里最后不能加分号,否则他把 max 的值定义为“1001;”int s[10][10];int t[10][10][5];int map[4][2]={{1,0},{0,1},{-1,0},{0,-1}};...
阅读全文
posted @
2010-05-12 11:10
VRS
阅读(387)
推荐(0)
ZOJ 2099
摘要:#include<iostream>#include<math.h>using namespace std;int main(){ long a,b; cin>>a>>b; long xmin,xmax,ymin,ymax; while(!(a==0 && b==0)) { xmin=ymin=2147483647; xmax=y...
阅读全文
posted @
2010-05-12 11:10
VRS
阅读(141)
推荐(0)
ZOJ 2104
摘要://2104 颜色数目最多的气球的颜色//算法:先将给出的气球颜色输入进数组col[],然后逐个拿出数组col[]中第i个气球与剩下的n-i个比较,// 总共比较n(n-1)/2次,比较过程中把重复的比较减去,实际比较远少于n(n-1)/2。#include<iostream>using namespace std;struct Color{ char str[20]; //记录气球颜...
阅读全文
posted @
2010-05-12 11:10
VRS
阅读(280)
推荐(0)
ZOJ 2022
摘要:#include<iostream>#include<stdio.h>using namespace std;//记住,数据量大的时候scanf和cin的速度是相差很多的!int main(){ long num; long n; long sum;// cin>>n; scanf("%ld",&n); while(n--) { scanf("%ld"...
阅读全文
posted @
2010-05-12 11:09
VRS
阅读(208)
推荐(0)
ZOJ 1986 最长升序数
摘要://////////////////////////////////////最长升序数//用dp+二分法//若用常规的做法用n^2的时间,用二分以后降为nlogn// 这种二分法很巧妙,先弄一个数组st[],每次读入a[i],找出在st[]中刚比它小的后一位st[k]//用a[i]替换s[k]。当k小于len时,这种替换不会改变最长链的最大数;当k=len时,最大链最大数//被改为一个更小的数a[...
阅读全文
posted @
2010-05-12 11:08
VRS
阅读(165)
推荐(0)
ZOJ 2001
摘要:#include<iostream>#include<math.h>using namespace std;//倒转函数int chang(int a){ int comp; int len=0; comp=a; while(comp!=0) { len++; comp/=10; } int out=0; int i; int bit; while(a!=0) { i...
阅读全文
posted @
2010-05-12 11:08
VRS
阅读(179)
推荐(0)
ZOJ 1915
摘要:#include <iostream>#include<iomanip>using namespace std;double st[1005];int main(){ double aver; int n,num; cin>>n; while(n--) { cin>>num; int i; aver=0; for(i=0;i<num;i...
阅读全文
posted @
2010-05-12 11:07
VRS
阅读(179)
推荐(0)
ZOJ 1940 走三维迷宫
摘要:#include<iostream>#include<queue>using namespace std;int MAP[6][3]={{1,0,0},{0,-1,0},{0,1,0},{-1,0,0},{0,0,1},{0,0,-1}};char a[30][30][30];int x,y,z;typedef struct{int z;int y;int x;int mo...
阅读全文
posted @
2010-05-12 11:07
VRS
阅读(347)
推荐(0)
ZOJ 1904 海狸咬木
摘要:// 1904 海狸咬木// 一道简单的数学题#include <iostream>#include <math.h>#include <iomanip>using namespace std;#define Pi 3.1415926int main(){ double D,V; double d; while(cin>>D>>V &am...
阅读全文
posted @
2010-05-12 11:06
VRS
阅读(253)
推荐(0)
ZOJ 1889 n的倍数使11111…位数最少
摘要://////////////////////////////////////////////////////////1889 n的倍数使11111…位数最少//思路:使题意转变为:给出n,算出最小的x满足10^x mod 9n = 1 (思路完全与1489一样)// 高精度,需要不断地缩小数据的规模。首先,n=1时,x=0;// 其次,每次把10^k nod 9n的余数乘10,得到是...
阅读全文
posted @
2010-05-12 11:06
VRS
阅读(376)
推荐(0)
ZOJ 1796
摘要:///////////////////////////////////////////////////////#include <iostream>using namespace std;int main(){ int A,a,B,b,C,c; while(cin>>A>>a>>B>>b>>C>>c &&a...
阅读全文
posted @
2010-05-12 11:05
VRS
阅读(159)
推荐(0)
ZOJ 1813
摘要:///////////////////////////////////////////////////////#include <iostream>#include<iomanip>using namespace std;#define Pi 3.1415927int main(){ double dia,n,time; double ans; int counter=1;...
阅读全文
posted @
2010-05-12 11:05
VRS
阅读(104)
推荐(0)
ZOJ 1879
摘要:///////////////////////////////////////////////////////#include <iostream>#include <algorithm>using namespace std;bool st[3000];int main(){ int n; int a,b; while(cin>>n) { cin>&g...
阅读全文
posted @
2010-05-12 11:05
VRS
阅读(166)
推荐(0)
ZOJ 1760 多少个两倍数
摘要://////////////////////////////////////////#include<iostream>#include<algorithm>using namespace std;int st[16];int main(){ int i; int ans; while(cin>>st[0] && st[0]!=-1) { an...
阅读全文
posted @
2010-05-12 11:04
VRS
阅读(186)
推荐(0)
ZOJ 1763
摘要:///////////////////////////////////////////////////////#include<iostream>#include <iomanip>using namespace std;int main(){ float a,b; cin>>a; while(cin>>b && b!=999) { ...
阅读全文
posted @
2010-05-12 11:04
VRS
阅读(142)
推荐(0)
ZOJ 1733 最长公共子串
摘要://////////////////////////////////////////////////////////////////////最长公共子串//dp经典例题#include<iostream>#include<string>using namespace std;char x[10000],y[10000];void LCSLength(int m,int n,...
阅读全文
posted @
2010-05-12 11:03
VRS
阅读(237)
推荐(0)
ZOJ 1755 粘土容积
摘要://///////////////////////////////////////////////////////////#include<iostream>using namespace std;char st[10][10];int dimen[10];int main(){ int n; while(cin>>n && n!=-1) { int i;...
阅读全文
posted @
2010-05-12 11:03
VRS
阅读(232)
推荐(0)
ZOJ 1730 圆桌换序
摘要:///////////////////////////////////////////////////////数学题// 要交换次数少,关键是绕长度少于半圆的方向去交换// 我是以A1与An为分界把Ai与(An+1)-Ai交换到分界处,均交换i-1次,一直算到An/2,// 若n为奇数则再加上(An+1)/2的交换次数#include<iostream>using namespace ...
阅读全文
posted @
2010-05-12 11:02
VRS
阅读(265)
推荐(0)
ZOJ 1649 监狱营救
摘要:#include<iostream>#include<queue>using namespace std;char a[205][205],guodu[205][205];int t[205][205],guodu2[205][205];int map[4][2]={{1,0},{0,1},{0,-1},{-1,0}};int x,y,counter;struct node...
阅读全文
posted @
2010-05-12 11:01
VRS
阅读(342)
推荐(0)
ZOJ 1715
摘要://////////////////////////////////////////////////////用鸽巢原理#include<iostream>using namespace std; int buc[1005];int main(){ int N,Q; while(cin>>N>>Q && !(N==0 && Q==0...
阅读全文
posted @
2010-05-12 11:01
VRS
阅读(232)
推荐(0)
ZOJ 1642 带权的最长公共子串
摘要://////////////////////////////////////////////////////////////////////带权的最长公共子串//dp经典例题#include<iostream>#include<string>using namespace std;char x[5000],y[5000];char ch[256];int a[256];vo...
阅读全文
posted @
2010-05-12 11:00
VRS
阅读(187)
推荐(0)
ZOJ 1622
摘要://///////////////////////////////////////#include<iostream>using namespace std;int main(){ int n; while(cin>>n) { int i,count=0; int *a=new int[n+1]; for(i=0;i<n;i++) cin>>a[i]...
阅读全文
posted @
2010-05-12 10:59
VRS
阅读(120)
推荐(0)
ZOJ 1514
摘要:////////////////////////////////////////////////////////////////////鸽巢原理做#include<iostream>using namespace std;int buc[10001],peo[20001];int main(){ int i,n,m,count; while(cin>>n>>m ...
阅读全文
posted @
2010-05-12 10:58
VRS
阅读(159)
推荐(0)
ZOJ 1494 爬虫爬井
摘要:#include<iostream>using namespace std;int main(){ int n,u,d; int min,dis; while(cin>>n>>u>>d && !(n==0&&u==0&&d==0)) {/* min=n*2/(u-d); if(min*(u-d)/2+2...
阅读全文
posted @
2010-05-12 10:57
VRS
阅读(187)
推荐(0)
ZOJ 1414
摘要:#include<iostream>using namespace std;int main(){ int out,n,x,y; cin>>n; while(n--) { cin>>x>>y; if(x==y||x-y==2) { if(x%2==0) out=x+y; else out=x+y-1; cout<<out<&l...
阅读全文
posted @
2010-05-12 10:55
VRS
阅读(127)
推荐(0)
ZOJ 1489 2^x mod n = 1
摘要://////////////////////////////////////////////////////////2^x mod n = 1//给出n,算出最小的x满足2^x mod n = 1//思路:高精度,需要不断地缩小数据的规模。首先,n=1和n=2的倍数时不存在x,// 其次,每次把2^k nod n的余数乘2,得到是原(2^k)*2的余数,即2^(k+1)// 的余数。#includ...
阅读全文
posted @
2010-05-12 10:55
VRS
阅读(209)
推荐(0)
ZOJ 1406 最小花费路
摘要://////////////////////////////////////////////////////////////最小花费路//用最小生成树Prim算法#include<iostream>using namespace std;#define MAX 1000int c[28][28];//先让输入转化为邻接矩阵储存void input(int n){ int i,j,num...
阅读全文
posted @
2010-05-12 10:54
VRS
阅读(343)
推荐(0)
ZOJ 1405 日光浴厅
摘要:#include<iostream>#include<string>using namespace std;char shu[100],cun[50],zou[50];int main(){ int i,j,num,len,jishu1,jishu2,duwei,yiyou,yizou,zouren; while(cin>>num && num)...
阅读全文
posted @
2010-05-12 10:53
VRS
阅读(269)
推荐(0)
如何调整显示器保护视力
摘要:电脑护眼攻略步骤: 目前,一种神秘的电脑护眼攻略在白领中流行:桌面->右键->属性->外观->高级->项目选择(窗口)、颜色1(L)选择(其它)将色调改为:85。饱和度:123。亮度:205->添加到自定义颜色->在自定义颜色选定点确定->确定这样所有的文档都不再是刺眼的白底黑字,而是非常柔和的豆沙绿色。 这种调节屏幕的办法,在办公室中非常风靡,据...
阅读全文
posted @
2010-05-11 11:33
VRS
阅读(556)
推荐(0)
(转)如何撰写数学建模论文
摘要:如何撰写数学建模论文--兼谈数学建模竞赛答卷要求当我们完成一个数学建模的全过程后,就应该把所作的工作进行小结,写成论文。撰写数学建模论文和参加大学生数学建模竞赛时完成答卷,在许多方面是类似的。事实上数学建模竞赛也包含了学生写作能力的比试,因此,论文的写作是一个很重要的问题。首先要明确撰写论文的目的。数学建模通常是根据实际需要而提出的,这就要求对建模全过程作一个全面的、系统的小结,使有关的技术人员(...
阅读全文
posted @
2010-05-11 11:16
VRS
阅读(543)
推荐(0)
(转)逃出你的肖申克(二):仁者见仁智者见智?从视觉错觉到偏见
摘要:《Making Up the Mind》上讲了这么一个简单但深刻的实验: 我们看到这张图片的第一反应是:5个凸的按钮,1个凹的按钮。现在仅仅将图片上下颠倒一下: 在我们眼中立即就变成了:1个凸的按钮,5个凹的按钮。为什么同一副图片,仅仅是上下颠倒一下,我们就对其作出了完全不同的解释呢?我们知道,视觉图像要到达大脑,首先要在视网膜上成像(视网膜上密密麻麻地排布着感光细胞),刺激感光细胞形成的神经电冲...
阅读全文
posted @
2010-05-11 10:53
VRS
阅读(1016)
推荐(2)
ZOJ 1402 圆桌派菜
摘要:#include<iostream>using namespace std;int shu[100];int main(){ int num,i,j,sam,ella; cin>>num; while(num) { sam=ella=0; for(i=0;i<num;i++) cin>>shu[i]; j=num-1; i=0; sam+=shu...
阅读全文
posted @
2010-05-11 10:31
VRS
阅读(237)
推荐(0)
ZOJ 1383 输出二进制为“1”的位
摘要:#include<iostream>using namespace std;int shu[100];int main(){ long n,a,i,j,jishu,temp; cin>>n; while(n--) { cin>>a; jishu=0; i=0; while(a!=0) { temp=a%2; a/=2; if(temp==1) { sh...
阅读全文
posted @
2010-05-11 10:30
VRS
阅读(376)
推荐(0)
ZOJ 1394 外星人探索
摘要:#include<iostream.h>#include<string.h>//using namespace std;char start[100],end[100];#define pi 3.14159;int main(){ int amou,ang,rad; double dist; while(cin>>start && strcmp(...
阅读全文
posted @
2010-05-11 10:30
VRS
阅读(204)
推荐(0)
ZOJ 1382 n = o2^p
摘要:#include<iostream.h>#include<math.h>//using namespace std;float shu[100];int main(){ float num,n; int i,j,jishu; float temp; cin>>num; for(i=0;i<25;i++) shu[i]=pow(2,i); while(nu...
阅读全文
posted @
2010-05-11 10:29
VRS
阅读(148)
推荐(0)
ZOJ 1365 飞行距离费用
摘要:#include<iostream>using namespace std;char f[100],t[100],zifu[5];int main(){ float num,sum; do{ cin>>f; if(f[0]=='#') break; cin>>t; sum=0; while(1) { cin>>num>>zi...
阅读全文
posted @
2010-05-11 10:28
VRS
阅读(198)
推荐(0)
ZOJ 1350 监狱守长
摘要:#include<iostream>using namespace std;int s[1000][200];int main(){ int n,num,i,j,jishu,cishi=0; cin>>n; while(n--) { cin>>num; memset(s[cishi],0,sizeof(s[cishi])); for(i=2;i<=n...
阅读全文
posted @
2010-05-11 10:27
VRS
阅读(171)
推荐(0)
ZOJ 1338 升、降序平均长度
摘要:#include<iostream>#include<iomanip>using namespace std;int shu[100],up[2],down[2];int main(){ int i,j,temp,jishu,baoji; double a,b; while((cin>>shu[0]) && shu[0]!=0) { a=0; ...
阅读全文
posted @
2010-05-11 10:26
VRS
阅读(252)
推荐(0)
ZOJ 1337 集合、关系求pi
摘要:#include<iostream.h>#include<math.h>#include<iomanip.h>//using namespace std;int shu[100];int main(){ int a,b,n,i,j,temp,jishu; double pair; while((cin>>n) && n!=0) { ...
阅读全文
posted @
2010-05-11 10:25
VRS
阅读(180)
推荐(0)
ZOJ 1331 完美立方体
摘要:#include<iostream.h>#include<math.h>double shu[201];void jian(){ int i; for(i=1;i<=200;i++) shu[i]=pow(i,3);}int main(){ int a,b,c,d; jian(); for(a=6;a<=200;a++) { for(b=2;b<a;b...
阅读全文
posted @
2010-05-11 10:24
VRS
阅读(197)
推荐(0)
ZOJ 1334 任意进制转换
摘要:#include<iostream.h>#include<string.h>#include<math.h>#include<iomanip.h>char s[100];char chu[1000][100]; //由于每一次输出chu,之后如果又使用chu的话,chu里面的数据并 //没有消去,则有问题,所以开了一个字符串数组1000位,但这好 /...
阅读全文
posted @
2010-05-11 10:24
VRS
阅读(293)
推荐(0)
ZOJ 1292 多个大数相加
摘要:#include<iostream>using namespace std;char s[105][105],chu[105][105];char din[105];int k1,k2;int main(){ din[0]='0'; int k,n,i,j,n1,n2,a,b,c,num; cin>>n; while(n--) { k=0; i=0; memset(s,...
阅读全文
posted @
2010-05-11 10:23
VRS
阅读(283)
推荐(0)
ZOJ 1251 移动箱至平均
摘要:#include<iostream>using namespace std;int shuru[105]; int main(){ int n,jishu=0,j=1; int i,sum=0; while(cin>>n && n!=0) { for(i=0;i<n;i++) { cin>>shuru[i]; sum+=shuru[i]...
阅读全文
posted @
2010-05-11 10:22
VRS
阅读(183)
推荐(0)
ZOJ 1241 求直角三角形第三边
摘要://Geometry Made Simple//求直角三角形第三边#include<iostream.h>#include<string.h>#include<math.h>#include<iomanip.h>//using namespace std;int main(){ int shu[3],i,j=1; char ch; double ch...
阅读全文
posted @
2010-05-11 10:21
VRS
阅读(229)
推荐(0)
ZOJ 1242 碳14
摘要:#include<iostream.h>#include<math.h>//using namespace std; //公式是N=No(1/2)^(t/T),由于No=原子数(题中的w)* 810, //而N为t时刻的原子总质量(题中的d),使公式变形,得:int main() // t=5730*log((810*w)/d){ int num,sen,j=1; doub...
阅读全文
posted @
2010-05-11 10:21
VRS
阅读(239)
推荐(0)
ZOJ 1240 IBM
摘要://IBM Minus One#include<iostream>#include<string>using namespace std;char s[100];int main(){ int i,n,num,k; cin>>num; n=num; while(n--) { cin>>s; k=strlen(s); for(i=0;i<k...
阅读全文
posted @
2010-05-11 10:20
VRS
阅读(147)
推荐(0)
ZOJ 1216
摘要:////////////////////////////////////////////////////////////////////Deck//叠多少张牌可超桌面多少#include<iostream.h>#include<iomanip.h>//using namespace std;int main(){ int n,i; float out; cout<&l...
阅读全文
posted @
2010-05-11 10:20
VRS
阅读(168)
推荐(0)
ZOJ 1205 二十进制相加
摘要://////////////////////////////////////////////////////////////////Martian Addition//火星人(二十进制相加)#include<iostream>#include<string>using namespace std;char s1[105],s2[105];char chu[105];int ...
阅读全文
posted @
2010-05-11 10:19
VRS
阅读(284)
推荐(0)
ZOJ 1201 逆序数序与其求原序
摘要://///////////////////////////////////////////////////////////////////////Inversion//逆序数序与其求原序#include<iostream>#include<string>using namespace std;char nor[100];long shuru[10000];long chu[...
阅读全文
posted @
2010-05-11 10:18
VRS
阅读(357)
推荐(0)
ZOJ 1151 字符逆置
摘要://///////////////////////////////////////////////////////////////////////////Word Reversal//字符逆置#include<iostream.h>#include<string.h>char s[10000][1000];int i,j,k;int main(){ int m,n,jis...
阅读全文
posted @
2010-05-11 10:17
VRS
阅读(354)
推荐(0)
ZOJ 1115 位数和的因子
摘要://///////////////////////////////////////////////////////Digital Roots//位数和的因子#include<iostream>#include<string>using namespace std;char n[10000];int main(){ memset(n,-1,sizeof(n)); int nu...
阅读全文
posted @
2010-05-11 10:17
VRS
阅读(177)
推荐(0)
ZOJ 1108 白老鼠越大越慢
摘要:////////////////////////////////////////////////////////////FatMouse's Speed 白老鼠越大越慢//利用dp,与DNA序列相似#include<iostream>using namespace std;int st[1001][2], output[1001]; class Mouse{public: int si...
阅读全文
posted @
2010-05-11 10:16
VRS
阅读(331)
推荐(0)
ZOJ 1094 带括号的矩阵连乘
摘要:////////////////////////////////////////////////////////带括号矩阵连乘的模拟//使用stack来解决#include<iostream>#include<stack>#include<string>using namespace std;struct matrx{ int row; int col;}ma[...
阅读全文
posted @
2010-05-11 10:16
VRS
阅读(361)
推荐(0)
ZOJ 1093 猴子与香蕉
摘要:///////////////////////////////////////////////////////////////////////猴子与香蕉//把每一种方块化为三个,先排序,再用n^2的dp#include<iostream>#include<algorithm>using namespace std;struct block{ int x; int y; in...
阅读全文
posted @
2010-05-11 10:15
VRS
阅读(349)
推荐(0)
ZOJ 1090 三点求圆周
摘要:////////////////////////////////////////////////////1090一道数学题//已知三点的坐标,求以此三点所确定的圆的周长//先用余弦定理cosα=(b^2+c^2-a^2)/(2bc),再求sinα,那么直径d=a/sinα,周长l=dπ#include<iostream>#include<...
阅读全文
posted @
2010-05-11 10:14
VRS
阅读(273)
推荐(0)
ZOJ 1088 约瑟夫问题
摘要://////////////////////////////////////////////////////1088约瑟夫问题// 这里我用了简化算法,参考以下的说明,只是有点不同先把第一个删掉,从第二个开始数,// 循环n-1遍(因为已去掉首个),最终剩下当前的第一个结束。#include<iostream>using namespace std;int main(){ int n;...
阅读全文
posted @
2010-05-11 10:13
VRS
阅读(530)
推荐(0)
ZOJ 1076 Gene Assembly
摘要://////////////////////////////////////////////////////////Gene Assembly//DNA序列中最多gene序列//用贪心法,先以基因头位置对基因排序,再用静态链存储、搜索#include<iostream>using namespace std;#define MAX 1005long st[MAX][2],output[...
阅读全文
posted @
2010-05-11 10:12
VRS
阅读(516)
推荐(0)
ZOJ 1074 最大子矩阵和问题
摘要://////////////////////////////////////////////////////////////////最大子矩阵和问题#include<iostream>using namespace std;int MaxSum(int n,int *a){ int i; int b; b=0; int max=0; for(i=1;i<=n;i++) { if...
阅读全文
posted @
2010-05-11 10:12
VRS
阅读(208)
推荐(0)
ZOJ 1070 计算电路电压
摘要://一道物理题,VR=VS*R*C*w/sqrt(R^2*C^2*w^2+1)#include<iostream>#include<iomanip>#include<cmath>using namespace std;int main(){ double VS,R,C; int n,s; cin>>VS>>R>>C>&g...
阅读全文
posted @
2010-05-11 10:11
VRS
阅读(360)
推荐(0)
ZOJ 1068 (其他进制是否回文数)
摘要://////////////////////////////////////////////1068(其他进制是否回文数)#include<iostream>using namespace std;unsigned int st[100];//判断数组st是否前len位是否为回文数bool deter_palin(int len){ int i; bool flags=1; for(i...
阅读全文
posted @
2010-05-11 10:10
VRS
阅读(236)
推荐(0)
ZOJ 1068 摩斯密码
摘要://///////////////////////////////////////////////////////1068摩斯密码//直接模拟#include<iostream>#include<algorithm>using namespace std;char code[35][2][5]; //记录29个摩斯密码 char str[150]; //记录输入的原码cha...
阅读全文
posted @
2010-05-11 10:09
VRS
阅读(306)
推荐(0)
ZOJ 1067 最接近颜色点
摘要:////////////////////////////////////////////////////////////////////Color Me Less//最接近颜色点#include<iostream.h>#include<math.h>int shu[16][3];int i,j;void shuru(){ for(i=0;i<16;i++) for(...
阅读全文
posted @
2010-05-11 10:08
VRS
阅读(219)
推荐(0)
ZOJ 1051 细菌培养基
摘要://A New Growth Industry//细菌培养基#include<iostream>using namespace std;int shu[25][25],guodu[25][25];int d[16];int main(){ int n,i,j,tianshu,temp; cin>>n; while(n--) { memset(shu,0,sizeof(sh...
阅读全文
posted @
2010-05-11 10:06
VRS
阅读(278)
推荐(0)
ZOJ 1049
摘要://I Think I Need a Houseboat//以圆面积扩散,要几年淹没#include<iostream.h>#include<math.h>#define pi 3.1415926int main(){ float i,j; int n,s;// cout<<int(624*pi/100+0.5); cin>>n; s=n; whil...
阅读全文
posted @
2010-05-11 10:05
VRS
阅读(261)
推荐(0)
ZOJ 1048
摘要://Financial Management//求平均数#include<iostream>using namespace std;int main(){ int i=12; float n,sum=0; while(i--) { cin>>n; sum+=n; } cout<<"$"<<sum/12.0<<endl; return ...
阅读全文
posted @
2010-05-11 10:05
VRS
阅读(144)
推荐(0)
ZOJ 1047 物体堆的边界
摘要:广搜#include<iostream>#include<queue>using namespace std;int Map[8][2]={{-1,0},{1,0},{0,-1},{0,1},{-1,-1},{-1,1},{1,-1},{1,1}};char Gra[25][25];struct node { int x; int y;}start,temp;int mai...
阅读全文
posted @
2010-05-11 10:03
VRS
阅读(290)
推荐(0)
ZOJ 1045
摘要:#include<iostream>using namespace std;int main(){ float num,sum,i; while(cin>>num && num!=0.00) { i=2; sum=0; while(1) { sum+=1/i; if(sum>=num) { cout<<i-1<<" ca...
阅读全文
posted @
2010-05-11 10:02
VRS
阅读(165)
推荐(0)
ZOJ 1009 转子加密
摘要://这里有新的输入输出格式,注意其实输入格式跟输出格式是分开的,即系就算某一输出改变在另一输入前,//只要输出格式符合要求就行//用三重for做#include<iostream>#include<string>using namespace std;int st[3][30],sttemp[3][30];char s[10000];void insert(int n){ ...
阅读全文
posted @
2010-05-11 10:01
VRS
阅读(526)
推荐(0)
ZOJ 1006 加密
摘要://除余加密//由于被除数与余数同余,而且均小于28,则相互mod相同#include<iostream>#include<string>using namespace std;char st[100],en[100];int stnum[100],ennum[100];int main(){ int i,k,len,pos; while(cin>>k &...
阅读全文
posted @
2010-05-11 10:00
VRS
阅读(219)
推荐(0)
ZOJ 1949 奇偶矩阵
摘要:#include <iostream>using namespace std;int st[105][105];int row[105],col[105];int main(){ int n; while(cin>>n && n!=0) { int i,j; for(i=0;i<n;i++) { row[i]=0; col[i]=0; } f...
阅读全文
posted @
2010-05-11 09:59
VRS
阅读(200)
推荐(0)
ZOJ 1002 最大堡垒数
摘要://///////////////////////////////////////////////最大堡垒数//用回溯法(其实是N皇后问题的改装)+暴力A掉#include<iostream>#include<math.h>using namespace std;char a[5][5];//堡垒类,方便对成员的访问class Blockhouses{ friend int...
阅读全文
posted @
2010-05-11 01:21
VRS
阅读(271)
推荐(0)
如何写参数个数不定的函数(即类似printf的函数)
摘要:#include <stdio.h>#include <stdarg.h>//要包含这个头文件void variable(int i, ...){int j = 0; va_list arg_ptr;//第1步,定义这个指向参数列表的变量 va_start(arg_ptr, i);//第2步,把上面这个变量初始化.即让它指向参数列表while( j != -1 ) {//第...
阅读全文
posted @
2010-05-10 19:00
VRS
阅读(2213)
推荐(0)