自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

西西里的美丽传说

Keep moving......

  • 博客(13)
  • 收藏
  • 关注

原创 sicily 1752 选择

<br />最近一直都在做水题找自信中,嘿嘿....<br /> <br />// source code of submission 743067, Zhongshan University Online Judge System#include <iostream>#include <cstring>#include <algorithm>using namespace std;int prime(int a[],int n) //筛法素数

2011-04-30 16:10:00 762

转载 POJ分类

<br />POJ上的一些水题(可用来练手和增加自信)<br />(poj3299,poj2159,poj2739,poj1083,poj2262,poj1503,poj3006,poj2255,poj3094)<br />初期:<br />一.基本算法:<br />     (1)枚举. (poj1753,poj2965)<br />     (2)贪心(poj1328,poj2109,poj2586)<br />     (3)递归和分治法.<br />     (4)递推.<br />     (5)

2011-04-29 13:07:00 469

原创 sicily 1685 Missile

<br />刚开始对题意理解错误,wa了几次....<br /> <br />// source code of submission 737521, Zhongshan University Online Judge System#include <iostream>using namespace std;int main(){ int n,i,j,mis[1006]; while(cin>>n,n) { int max = 1;

2011-04-25 16:25:00 703

原创 sicily 1624 Cryptoquote

<br />很简单的一道题,只是这里输入的字符串包含空格,因此要用到getline或则gets,而不能用scanf("%s",str)。。。。。<br /> <br />// source code of submission 737435, Zhongshan University Online Judge System#include <iostream>#include <cstdio>#include <cctype>#include <string>using namespac

2011-04-25 16:16:00 450

原创 sicily 1625 Binary Clock

<br />蛮简单的一道题,10进制转2进制,然后数组操作就OK了.....<br /> <br />// source code of submission 734146, Zhongshan University Online Judge System#include <iostream>#include <cstring>#include <cstdio>using namespace std;int main(){ int n,i,j,h,m,s; i

2011-04-22 12:12:00 499

原创 sicily 1491 Look and Say

<br />简单题.....<br /> <br /> <br />// source code of submission 733747, Zhongshan University Online Judge System#include <iostream>#include <string>using namespace std;int main(){ int n,i,num; string s; cin>>n; while(n--)

2011-04-22 11:01:00 496

原创 sicily 1394 Root of the Problem

<br />这道题理解了题意应该就很简单了吧..我用的是枚举,同时利用了指数函数的单调递增性,一旦试到某个A的N次方减去B大于当前的min值,就跳出循环,因为就算继续下去,只会得到更大的AN -B。<br /> <br /> <br />// source code of submission 733659, Zhongshan University Online Judge System#include <iostream>#include <cmath>using namespace std

2011-04-22 10:59:00 715

原创 sicily 1372 Bovine Latin

这道题还是比较简单的,就当做复习C++ 的string用法好了..// source code of submission 733589, Zhongshan University Online Judge System#include #include using namespace std;int main(){ string s; int n,i,len; cin>>n; while(n--) { cin

2011-04-22 10:50:00 562

原创 sicily 1137 河床

<br />// source code of submission 733540, Zhongshan University Online Judge System#include <iostream>#include <algorithm>using namespace std;int depth[30006],a[30000];int max_dis(int a [],int t) //求某个区间内最大数与最小数之差 {

2011-04-21 19:55:00 712

原创 sicily 1934移动小球

这道题在刘汝佳的《算法竞赛入门经典》里面有讲,之前用vector,超时!参考了别人的程序以后才AC,要注意输出语句的写法,以下是该题的算法(非原创)。// source code of submission 733152, Zhongshan University Online Judge System//这道题解强调小球之间的相对顺序,而非绝对顺序;//我们定义了结构体node,并用left,right来表示小球i的左边和右边小球的编号。//移动的过程分为两步:把小球X逸出序列;把X重新插入序

2011-04-21 15:36:00 1950 1

原创 sicily 1046 Plane Spotting

<br />// source code of submission 722250, Zhongshan University Online Judge System#include <iostream>#include <algorithm>using namespace std;struct node { float p_air; //某个时间段里的平均飞机数 int first; //时间段起点 int last; //时间

2011-04-21 14:06:00 1297

原创 sicily 1014 Specialized Four-Dig

<br />// source code of submission 721460, Zhongshan University Online Judge System#include <stdio.h>#include <string.h>void conversion(int num,char s2[],long d2){ long i,j,t; char c; i=0; while(1) { t=num%d2;

2011-04-21 14:01:00 721

原创 sicily 1006 Team Rankings

01.// source code of submission 731830, Zhongshan University Online Judge System 02.#include 03.#include 04.#include 05.usingnamespacestd; 06.  07.intfind(charx,charstr[])                         //寻找字符在指定字符串中的位置 08.{ 09.    intindex; 10.    for(inti =

2011-04-21 13:11:00 1076

空空如也

空空如也

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

TA关注的人

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