上一页 1 ··· 3 4 5 6 7 8 下一页

2013年1月23日

摘要: A. Stones on the Tabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arenstones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two neighboring stones had 阅读全文
posted @ 2013-01-23 10:19 aries__liu 阅读(299) 评论(0) 推荐(0) 编辑

2013年1月22日

摘要: GridlandTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2455Accepted Submission(s): 1168Problem DescriptionFor years, computer scientists have been trying to find efficient solutions to different computing problems. For some of them efficient algor 阅读全文
posted @ 2013-01-22 09:30 aries__liu 阅读(421) 评论(0) 推荐(0) 编辑
摘要: The Hardest Problem EverTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11459Accepted Submission(s): 5165Problem DescriptionJulius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In 阅读全文
posted @ 2013-01-22 09:29 aries__liu 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Climbing WormTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8745Accepted Submission(s): 5659Problem DescriptionAn inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minut 阅读全文
posted @ 2013-01-22 09:28 aries__liu 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Financial ManagementTime Limit: 400/200 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6666Accepted Submission(s): 4157Problem DescriptionLarry graduated this year and finally has a job. He’s making a lot of money, but somehow never seems to have enough. Larry has deci 阅读全文
posted @ 2013-01-22 09:27 aries__liu 阅读(359) 评论(0) 推荐(1) 编辑
摘要: Prerequisites?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 634Accepted Submission(s): 401Problem DescriptionFreddie the frosh has chosen to take k courses. To meet the degree requirements, he must take courses from each of several categories. Ca 阅读全文
posted @ 2013-01-22 09:26 aries__liu 阅读(153) 评论(0) 推荐(0) 编辑
摘要: An Easy TaskTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10133Accepted Submission(s): 6291Problem DescriptionIgnatius was born in a leap year, so he want to know when he could hold his birthday party. Can you tell him?Given a positive integers Y 阅读全文
posted @ 2013-01-22 09:24 aries__liu 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Lowest BitTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5440Accepted Submission(s): 3963Problem DescriptionGiven an positive integer A (1 <= A <= 100), output the lowest bit of A.For example, given A = 26, we can write A in binary form as 1 阅读全文
posted @ 2013-01-22 09:23 aries__liu 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 18岁生日Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12363Accepted Submission(s): 3885Problem DescriptionGardon的18岁生日就要到了,他当然很开心,可是他突然想到一个问题,是不是每个人从出生开始,到达18岁生日时所经过的天数都是一样的呢?似乎并不全都是这样,所以他想请你帮忙计算一下他和他的几个朋友从出生到达18岁生日所经过的总天数,让他好来比较一下。Input一个数T,后面T行每行有 阅读全文
posted @ 2013-01-22 09:22 aries__liu 阅读(174) 评论(0) 推荐(0) 编辑

2013年1月21日

摘要: A. Escape from Stonestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSquirrel Liss lived in a forest peacefully, but unexpected trouble happens. Stones fall from a mountain. Initially Squirrel Liss occupies an interval[0, 1]. Next,nstones will fa 阅读全文
posted @ 2013-01-21 10:53 aries__liu 阅读(360) 评论(0) 推荐(0) 编辑

2013年1月18日

摘要: Text ReverseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10835Accepted Submission(s): 4104Problem DescriptionIgnatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words 阅读全文
posted @ 2013-01-18 02:12 aries__liu 阅读(1453) 评论(0) 推荐(0) 编辑

2013年1月15日

摘要: A. Roma and Lucky Numberstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRoma (a popular Russian name that means 'Roman') loves the Little Lvov Elephant's lucky numbers.Let us remind you that lucky numbers are positive integers whose d 阅读全文
posted @ 2013-01-15 10:56 aries__liu 阅读(329) 评论(0) 推荐(0) 编辑

2013年1月11日

摘要: 不可摸数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5821Accepted Submission(s): 1524Problem Descriptions(n)是正整数n的真因子之和,即小于n且整除n的因子和.例如s(12)=1+2+3+4+6=16.如果任何数m,s(m)都不等于n,则称n为不可摸数.Input包含多组数据,首先输入T,表示有T组数据.每组数据1行给出n(2<=n<=1000)是整数。Output如果n是不可 阅读全文
posted @ 2013-01-11 11:15 aries__liu 阅读(407) 评论(0) 推荐(0) 编辑

2012年12月23日

摘要: t2.time获取秒,t2.millitm获取毫秒。详见网站:http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/timeb.h.html 阅读全文
posted @ 2012-12-23 21:34 aries__liu 阅读(339) 评论(0) 推荐(0) 编辑

2012年12月16日

摘要: 缩进:n, m > 表示从n行到m行缩进 缩出用 > n > 表示从当前行起,再往下数n行,缩进 缩出用 > n ==表示从当前行起,再往下数n-1行,自动排版 自动排版:G=gg 阅读全文
posted @ 2012-12-16 13:05 aries__liu 阅读(187) 评论(0) 推荐(0) 编辑

2012年12月15日

摘要: 多简洁的位运算! 阅读全文
posted @ 2012-12-15 14:30 aries__liu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 比增量构造要复杂,但是想法简洁 阅读全文
posted @ 2012-12-15 13:29 aries__liu 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 体会递归的想法,其实挺巧妙的。 阅读全文
posted @ 2012-12-15 13:06 aries__liu 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 实现很简洁,强大的STL 阅读全文
posted @ 2012-12-15 12:04 aries__liu 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 先把数列排序,再修改以前的程序。注意体会for里面的条件 阅读全文
posted @ 2012-12-15 11:41 aries__liu 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 注意多体会递归的想法 阅读全文
posted @ 2012-12-15 10:08 aries__liu 阅读(161) 评论(0) 推荐(0) 编辑

2012年12月14日

摘要: 双基回文数很多,所以可以暴力。 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 #include <iomanip> 5 6 using namespace std; 7 8 int trans(int n, int base) 9 {10 int a[100], i = 1;11 a[0]=n%base;12 n/=base;13 while (n)14 {15 a[i++]=n%base;16 n/=base;17 }18 ... 阅读全文
posted @ 2012-12-14 20:57 aries__liu 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 找出x,y的范围,枚举就可以了 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 5 using namespace std; 6 7 int main(void) 8 { 9 int k;10 #ifndef ONLINE_JUDGE11 freopen("in", "r", stdin);12 #endif13 while (~scanf("%d", &k))14 {15 for (int i = k+1; 阅读全文
posted @ 2012-12-14 20:00 aries__liu 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 因为范围只有18个数字,所以可以枚举起点和终点。 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 #include <cmath> 5 6 using namespace std; 7 8 long long int f(int a[], int start, int end) 9 {10 long long int sum = 1;11 for (int i = start; i < end + 1; ++i)12 {13 sum *= a[i];14 }1 阅读全文
posted @ 2012-12-14 19:40 aries__liu 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 这道题目还是卡了很久,原因是要考虑0是不是出现过,要标记。 1 #include <stdio.h> 2 #include <ctype.h> 3 #include <string.h> 4 #include <stdlib.h> 5 #include <math.h> 6 7 void f(int a[], int n) 8 { 9 a[n%10] = 1;10 n/=10;11 while (n)12 {13 a[n%10] = 1;14 n/=10;15 }16 return;17 }18 19 int m... 阅读全文
posted @ 2012-12-14 19:21 aries__liu 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 在编译的时候加上 -g 选项,如: g++ -Wall -g test.cpp -o test开始调试: gdb test基本命令:l 显示代码,是list的简写b 插入断点,是break的简写n 下一步,是next的简写s 单步运行,是stepinto的简写,可以进入函数内部p 打印,是print的简写,可以打印变量disp 在每一步运行中显示要求的变量,是display的简写d disp 编号 删除指定编号的display,d是delete的简写dis disp 编号 禁止指定编号的display,dis是disable的简写en disp 编号 恢复指定编号的display,en是ena 阅读全文
posted @ 2012-12-14 09:02 aries__liu 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 方法是利用快排的想法,效率O(N) 1 /* 2 * use the method of quicksort. The time efficiency is 3 * O(N). 4 * 5 * */ 6 #include <iostream> 7 #include <cstdlib> 8 #include <cstdio> 9 #include <iomanip> 10 11 using namespace std; 12 13 class Array 14 { 15 public: 16 friend istream & operato 阅读全文
posted @ 2012-12-14 08:52 aries__liu 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 唉,我太弱了,这么个简单的东西,还是用数组写的,却因为各种错误,弄了一个晚上,C++还得好好学啊,各种语法,要弄清楚。 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 #include <iomanip> 5 #include <cstring> 6 7 using namespace std; 8 9 class Polynomial 10 { 11 public: 12 Polynomial(int = 0); 13 friend istream & 阅读全文
posted @ 2012-12-14 08:44 aries__liu 阅读(925) 评论(0) 推荐(0) 编辑

2012年12月12日

摘要: 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 5 using namespace std; 6 7 int step = 1; 8 void move(char from, char to) 9 {10 printf("%d: %c->%c\n", step++, from, to);11 }12 void h(int n, char from, char via, char to)13 {14 if (n == 1) {move(from, to) 阅读全文
posted @ 2012-12-12 09:19 aries__liu 阅读(171) 评论(0) 推荐(0) 编辑

2012年12月10日

摘要: 其实,一天过完之后,你真应该问问自己,今天自己干嘛了?还记得昨天你干了什么吗?前天呢?如果你记不起来,那你多半是在混日子。 阅读全文
posted @ 2012-12-10 13:35 aries__liu 阅读(85) 评论(0) 推荐(0) 编辑

2012年12月4日

摘要: 1 /* 2 数组名和指针相同吗? 3 */ 4 5 #include <iostream> 6 #include <cstdlib> 7 #include <cstdio> 8 9 using namespace std;10 int a[][3] = {{1, 2, 3}, {1, 2, 3}, {4, 5, 6}, {3, 4, 5}};11 int sizef(int b[][3])12 {13 cout << sizeof(b) << endl;14 cout << sizeof(b[0]) << e 阅读全文
posted @ 2012-12-04 19:13 aries__liu 阅读(267) 评论(0) 推荐(0) 编辑

2012年11月29日

摘要: Tempter of the BoneTime Limit: 2 Seconds Memory Limit: 65536 KBThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone was a trap, and he tried desperate... 阅读全文
posted @ 2012-11-29 14:10 aries__liu 阅读(164) 评论(0) 推荐(0) 编辑

2012年11月27日

摘要: 计算阶乘两种写法:1 -module(continue).2 -export([factor/1]).3 factor(0) -> 1;4 factor(N) ->5 N * factor(N - 1).6 %factor(N) when N > 0 ->7 % N * factor(N - 1);8 %factor(0) -> 1.这里注意,第一种写法,如果输入的值是负数,那么函数进入死循环,内存溢出,第二种写法输入负数,函数会不执行。内置函数:hd/1 返回列表第一个元素tl/1 返回删除第一个元素后的其余部分length/1 返回列表的长度tuple_siz 阅读全文
posted @ 2012-11-27 15:45 aries__liu 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 1.函数举个例子:判断一个数字是奇数还是偶数1 -module(rev).2 -export([even/1]).3 4 even(Value) ->5 if 6 Value rem 2 == 1 -> odd;7 Value rem 2 == 0 -> even8 end.文件名和模块名要相同。在终端中引用函数的时候,先编译,c(rev). 然后引用函数 rev:even(N). 其中N是一个已经赋值的变量。上面的函数的另一种写法:1 -module(rev).2 -export([even/1]).3 4 even(Value) ->5 ca... 阅读全文
posted @ 2012-11-27 15:35 aries__liu 阅读(149) 评论(0) 推荐(0) 编辑

2012年11月26日

摘要: 打开文件:vim ~/.bashrc加上这条语句:set -o vi >> ~/.bashrc 阅读全文
posted @ 2012-11-26 01:16 aries__liu 阅读(234) 评论(0) 推荐(0) 编辑

2012年11月24日

摘要: 1.在终端运行的时候末尾要输入 . 号2.数学运算符:+ 加法 正号- 减法 负号* 乘法/ 浮点除法div 整数除法rem 整数取余3.基元表示文字常量4.布尔类型没有单独表示布尔类型的布尔值或字符and 与andalso 第一个参数为假,返回假则第二个参数不需计算or 或orelse 第一个参数是真,返回真,不计算第二个参数xor 异或 不同为真,相同为假not 非5.元组{a, b, c, d}元组中的数据元素不一定是相同的类型 阅读全文
posted @ 2012-11-24 19:56 aries__liu 阅读(273) 评论(0) 推荐(0) 编辑

2012年11月23日

摘要: Eddy's mistakesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5189Accepted Submission(s): 2956Problem DescriptionEddy usually writes articles ,but he likes mixing the English letter uses, for example "computer science" is written fre 阅读全文
posted @ 2012-11-23 18:51 aries__liu 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22041Accepted Submission(s): 9654Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数 阅读全文
posted @ 2012-11-23 18:46 aries__liu 阅读(200) 评论(0) 推荐(0) 编辑

2012年11月20日

摘要: 1. 首先换软件源。2. 如果安装vim的时候出现问题,比如:Reading package lists... DoneBuilding dependency tree Reading state information... DonePackage vim is not available, but is referred to by another package.This may mean that the package is missing, has been obsoleted, oris only available from another sourceE: Pac... 阅读全文
posted @ 2012-11-20 12:07 aries__liu 阅读(390) 评论(0) 推荐(0) 编辑

2012年11月12日

摘要: 百度文库里面有一个文档,叫做”ubuntu_12.04_安装_iNodeClient_教程“,按照那个做,安装上之后然后发现能通过身份验证,但是连不上网,继续执行下面的操作。sudo chmod -R 777 /home/suruibin/iNodeClient(后面这个路径改成你自己的安装目录)进入目录 cd iNodeClient 安装:sudo ./install.shsudo ln -s /usr/lib/i386-linux-gnu/libtiff.so.4 /usr/lib/i386-linux-gnu/libtiff.so.3sudo apt-get install libjp. 阅读全文
posted @ 2012-11-12 22:46 aries__liu 阅读(222) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页