Processing math: 100%

04 2015 档案

摘要:DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from... 阅读全文
posted @ 2015-04-30 19:47 Painting、时光 阅读(219) 评论(0) 推荐(0) 编辑
摘要:DescriptionCharlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motores... 阅读全文
posted @ 2015-04-29 21:32 Painting、时光 阅读(176) 评论(0) 推荐(0) 编辑
摘要:DescriptionFarmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are ... 阅读全文
posted @ 2015-04-29 18:31 Painting、时光 阅读(159) 评论(0) 推荐(0) 编辑
摘要:DescriptionNew Zealand currency consists of 100,50, 20,10, and 5notesand2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determ... 阅读全文
posted @ 2015-04-28 21:35 Painting、时光 阅读(157) 评论(0) 推荐(0) 编辑
摘要:DescriptionSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amo... 阅读全文
posted @ 2015-04-28 20:40 Painting、时光 阅读(141) 评论(0) 推荐(0) 编辑
摘要:Problem Description小明误入迷宫,塞翁失马焉知非福,原来在迷宫中还藏着一些财宝,小明想获得所有的财宝并离开迷宫。因为小明还是学生,还有家庭作业要做,所以他想尽快获得所有财宝并离开迷宫。Input有多组测试数据。每组数据第一行给出两个正整数n,m(0#include#include#... 阅读全文
posted @ 2015-04-28 19:40 Painting、时光 阅读(186) 评论(0) 推荐(0) 编辑
摘要:算法大意:从一个起点出发,到达所有需要达到的点,再回到本身,求最短路法一:用状态压缩思想#include#include#include#includeusing namespace std;int n;struct edge{ int x; int y;}a[20];int temp[... 阅读全文
posted @ 2015-04-28 15:30 Painting、时光 阅读(185) 评论(0) 推荐(0) 编辑
摘要:1.数组模拟链表实现struct edge{ int u,v,w,next;}a[MAX];int E,u,v,w;E = 0;memset(head,-1,sizeof(head));void add(int u,int v,int w){ a[E].u = u;a[E].v = v;... 阅读全文
posted @ 2015-04-28 13:25 Painting、时光 阅读(183) 评论(0) 推荐(0) 编辑
摘要:Description The contest is running and the judges is busy watching the progress of the contest. Suddenly, N - 1 (N #include#include#includeusing name... 阅读全文
posted @ 2015-04-27 21:55 Painting、时光 阅读(228) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionWLD likes playing with a sequencea[1..N]. One day he is playing with a sequence ofNintegers. For every index i, WLD wants to find t... 阅读全文
posted @ 2015-04-27 12:44 Painting、时光 阅读(276) 评论(1) 推荐(1) 编辑
摘要:140 - The 12th Zhejiang Provincial Collegiate Programming Contest - DBeauty of ArrayTime Limit:2 Seconds Memory Limit:65536 KBEdward has an arrayAwith... 阅读全文
posted @ 2015-04-26 15:39 Painting、时光 阅读(432) 评论(0) 推荐(0) 编辑
摘要:For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team fromNstudents of his university.Edward kno... 阅读全文
posted @ 2015-04-26 15:10 Painting、时光 阅读(168) 评论(0) 推荐(0) 编辑
摘要:DescriptionWhen the winter holiday comes, a lot of people will have a trip. Generally, there are a lot of souvenirs to sell, and sometimes the travele... 阅读全文
posted @ 2015-04-26 14:38 Painting、时光 阅读(222) 评论(0) 推荐(0) 编辑
摘要:DescriptionRecently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, th... 阅读全文
posted @ 2015-04-25 10:25 Painting、时光 阅读(112) 评论(0) 推荐(0) 编辑
摘要:DescriptionEmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping ... 阅读全文
posted @ 2015-04-25 09:53 Painting、时光 阅读(133) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If y... 阅读全文
posted @ 2015-04-22 20:01 Painting、时光 阅读(161) 评论(0) 推荐(0) 编辑
摘要:Description"Fat and docile, big and dumb, they look so stupid, they aren't muchfun..."- Cows with Guns by Dana LyonsThe cows want to prove to the publ... 阅读全文
posted @ 2015-04-22 16:49 Painting、时光 阅读(190) 评论(0) 推荐(0) 编辑
摘要:DescriptionYou have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is on CDs. You need to have it on tapes so ... 阅读全文
posted @ 2015-04-21 21:31 Painting、时光 阅读(241) 评论(0) 推荐(0) 编辑
摘要:Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每... 阅读全文
posted @ 2015-04-21 20:35 Painting、时光 阅读(173) 评论(0) 推荐(0) 编辑
摘要:dd大牛的《背包九讲》P01: 01背包问题题目有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。基本思路这是最基础的背包问题,特点是:每种物品仅有一件,可以选择放或不放。用子问题定义状态:即f[i... 阅读全文
posted @ 2015-04-21 20:00 Painting、时光 阅读(354) 评论(0) 推荐(0) 编辑
摘要:一 01背包:一件物品只能放一次二维动态转移方程 dp[i][j] = max(dp[i-1][j],dp[i-1][j-w[i]]+v[i])降低空间复杂度用一维: dp[j] = max(dp[j],dp[j-w[i]]+v[i]), j 从V到0(为了防止数组越界,到w[i])代码实现:#in... 阅读全文
posted @ 2015-04-21 18:58 Painting、时光 阅读(210) 评论(0) 推荐(0) 编辑
摘要:Description众所周知,程序员是种神奇的没有妹子的生物。有一个很厉害的程序员Doge,他没有妹子。于是他将自己心仪的n个妹子编号为1到n,然后制定了m个表白计划在接下来的t天内向妹子表白,对于某一个计划,他会在计划的第L天到第R天向编号为x的妹子每天表白一次。由于计划很多,有些表白区间可能有... 阅读全文
posted @ 2015-04-20 21:43 Painting、时光 阅读(200) 评论(0) 推荐(0) 编辑
摘要:Description还记得大学里学过的模电么,今天就让我们将与或非变成一道题吧。给你一个与或非的表达式,求出这个表达式的值,表达式总共有八种字符。三种逻辑运算符按照优先级排列如下。‘!’:表示取反。‘&’:逻辑与。‘|’:逻辑或。两个字符‘T’,‘F‘分别表示true和false。另外还有左右括号... 阅读全文
posted @ 2015-04-20 21:36 Painting、时光 阅读(296) 评论(1) 推荐(0) 编辑
摘要:#include#includeusing namespace std;int main(){ int n; int a[11][11]; while(~scanf("%d",&n)){ memset(a,0,sizeof(a)); int tot = ... 阅读全文
posted @ 2015-04-20 20:25 Painting、时光 阅读(204) 评论(0) 推荐(0) 编辑
摘要:Description汉诺塔(又称河内塔)问题是源于印度一个古老传说的益智玩具。大梵天创造世界的时候做了三根金刚石柱子,在一根柱子上从下往上按照大小顺序摞着64片黄金圆盘。大梵天命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一次只能移动一... 阅读全文
posted @ 2015-04-20 19:51 Painting、时光 阅读(1406) 评论(0) 推荐(0) 编辑
摘要:Description一常球赛开始前,售票工作正在进行中。每张球票为50元,现有k(1 #includeusing namespace std;int main(){ int T; scanf("%d",&T); while(T--){ int dp[30][30];... 阅读全文
posted @ 2015-04-20 18:44 Painting、时光 阅读(1412) 评论(0) 推荐(0) 编辑
摘要:Description一个猴子在一座不超过30级的小山上爬山跳跃,猴子上山一步可跳1级或跳3级,试求上山有多少种不同的爬法Input多组测试数据,每组输入1个整数n,表示山的台阶数Output对于输入的整数n求出多少种爬法Sample Input30Sample Output58425HINT大意:... 阅读全文
posted @ 2015-04-20 18:05 Painting、时光 阅读(2039) 评论(0) 推荐(0) 编辑
摘要:Descriptionn个水手来到一个岛上,采了一堆椰子后,因为疲劳都睡着了。一段时间后,第一个水手醒来,悄悄地将椰子等分成n份,多出一个椰子,便给了旁边的猴子,然后自己藏起一份,再将剩下的椰子重新合在一起,继续睡觉。不久,第二名水手醒来,同样将椰子了等分成n份,恰好也多出一个,也给了猴子。然而自己... 阅读全文
posted @ 2015-04-20 17:48 Painting、时光 阅读(1617) 评论(0) 推荐(0) 编辑
摘要:DescriptionDoctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a number when the su... 阅读全文
posted @ 2015-04-19 20:45 Painting、时光 阅读(174) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionPick two numbersai,aj(i≠j)from a sequence to maximize the value of their greatest common divisor.InputMultiple test cases. In the f... 阅读全文
posted @ 2015-04-19 20:42 Painting、时光 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Description给你一副无向图,每条边有边权,保证图联通,现在让你判断这个图是否有异或值大于零的环存在。Input多组测试数据,每组先输入两个数n m,表示图的点跟边的数量。然后是m行,每行三个数a b c。代表一条边的起点,终点,边权。1 #include#includeusing name... 阅读全文
posted @ 2015-04-18 18:48 Painting、时光 阅读(783) 评论(0) 推荐(0) 编辑
摘要:DescriptionYou've gotten ann × msheet of squared paper. Some of its squares are painted. Let's mark the set of all painted squares asA. SetAis connect... 阅读全文
posted @ 2015-04-17 19:48 Painting、时光 阅读(230) 评论(0) 推荐(0) 编辑
摘要:法一:调用algorithm的库函数__gcd 两个下划线法二:int GCD(int a,int b){return b == 0 ? a : GCD(b,a%b);} 阅读全文
posted @ 2015-04-17 11:41 Painting、时光 阅读(409) 评论(0) 推荐(0) 编辑
摘要:DescriptionSome days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number ... 阅读全文
posted @ 2015-04-17 11:37 Painting、时光 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Description已知一个圆的圆周被N个点分成了N段等长圆弧,求任意取三个点,组成锐角三角形的个数。Input多组数据。每组数据一个N (N ≤ 1000000)。Output对于每组数据,输出不同锐角三角形的个数。Sample Input345Sample Output105大意:数学推导,分... 阅读全文
posted @ 2015-04-17 11:27 Painting、时光 阅读(159) 评论(0) 推荐(0) 编辑
摘要:Description郭橐驼,不知始何名。病偻,隆然伏行,有类橐驼者,故乡人号之驼。驼闻之,曰:“甚善。名我固当。”因舍其名,亦自谓橐驼云。其乡曰丰乐乡,在长安西。驼业种树,凡长安豪富人为观游及卖果者,皆争迎取养。视驼所种树,或移徙,无不活;且硕茂,蚤实以蕃。他植者虽窥伺效慕,莫能如也。 有问之... 阅读全文
posted @ 2015-04-17 11:13 Painting、时光 阅读(181) 评论(0) 推荐(0) 编辑
摘要:http://paste.ubuntu.com/ 阅读全文
posted @ 2015-04-16 20:19 Painting、时光 阅读(297) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/acm_cxlove/article/details/7411602 阅读全文
posted @ 2015-04-15 15:02 Painting、时光 阅读(140) 评论(0) 推荐(0) 编辑
摘要:#include #include const int N = 1000000 + 5;char s[N],t[N];int lens,lent;int next[N];void get_fail() { next[0] = -1; for (int i = 1,j = -1; i < ... 阅读全文
posted @ 2015-04-14 21:44 Painting、时光 阅读(120) 评论(0) 推荐(0) 编辑
摘要:#include#include#includeusing namespace std;int main(){ int a[10]; int n; scanf("%d",&n); for(int i = 1; i <= n ; i++) scanf("%d",&... 阅读全文
posted @ 2015-04-14 21:14 Painting、时光 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Superbot is an interesting game which you need to control the robot on an N*M grid map.As you see, it's just a simple game: there is a control panel w... 阅读全文
posted @ 2015-04-14 20:28 Painting、时光 阅读(190) 评论(0) 推荐(0) 编辑
摘要:Pattern lock security is generally used in Android handsets instead of a password. The pattern lock can be set by joining points on a 3 × 3 matrix in ... 阅读全文
posted @ 2015-04-13 12:53 Painting、时光 阅读(221) 评论(0) 推荐(0) 编辑
摘要:DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have ... 阅读全文
posted @ 2015-04-11 20:18 Painting、时光 阅读(122) 评论(0) 推荐(0) 编辑
摘要:转自perlman 原文链接:戳这里命令历史以:和/开头的命令都有历史纪录,可以首先键入:或/然后按上下箭头来选择某个历史命令。启动vim在命令行窗口中输入以下命令即可vim 直接启动vimvim filename 打开vim并创建名为filename的文件文件命令打开单个文件vim file同时... 阅读全文
posted @ 2015-04-11 19:47 Painting、时光 阅读(217) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示