03 2015 档案

摘要:Problem DescriptionA group of transformers whose leader isOptimus Prime(擎天柱) were assigned a mission: todestroy all Decepticon's(霸天虎) bases.The bases ... 阅读全文

posted @ 2015-03-31 23:45 LLGemini 阅读(155) 评论(0) 推荐(0)

摘要:题目链接题意:给出m行n列的棋盘,当两皇后在同行同列或同对角线上时可以互相攻击,问共有多少种攻击方式。分析:首先可以利用加法原理分情况讨论:①两皇后在同一行;②两皇后在同一列;③两皇后在同一对角线( / 或 \ ); 其次利用乘法原理分别讨论: ①同一行时(A),先选某一行某一列放置其中一个... 阅读全文

posted @ 2015-03-27 23:45 LLGemini 阅读(244) 评论(0) 推荐(0)

摘要:题目链接题意:“铁人三项”比赛中,需要选手在t km的路程里进行马拉松和骑自行车项目。现有n名选手,每位选手具有不同的跑步速度和骑车速度。其中第n位选手贿赂了裁判员,裁判员保证第n名选手一定会取得冠军。问当马拉松路程与自行车路程分别为多少时,第n名选手才能取得冠军。输出冠军与第二名所差的秒数以及马拉... 阅读全文

posted @ 2015-03-27 10:23 LLGemini 阅读(788) 评论(0) 推荐(0)

摘要:Josephina is a clever girl and addicted to Machine Learning recently. She pays much attention to a method called Linear Discriminant Analysis, which h... 阅读全文

posted @ 2015-03-25 20:09 LLGemini 阅读(585) 评论(0) 推荐(0)

摘要:题目链接题意:解方程:p ∗ e^(−x) + q ∗ sin(x) + r ∗ cos(x) + s ∗ tan(x) + t ∗ x^2 + u = 0 (0 =0&&F(1) 2 #include 3 #include 4 #include 5 using namespace std; 6 c... 阅读全文

posted @ 2015-03-25 18:46 LLGemini 阅读(153) 评论(0) 推荐(0)

摘要:题目链接题意:给出一个数S,求一个最大的数,使这个数所有的因子之和为S;这个所谓“因子之和”不知道有没有误导性,因为一开始以为得是素数才行。后来复习了下小学数学,比如12的因子分别是1,2,3,4,6,12...我竟无言以对T^T...感觉复杂度应该能继续优化的。。没想到好的。。代码: 1 #inc... 阅读全文

posted @ 2015-03-21 14:21 LLGemini 阅读(236) 评论(0) 推荐(0)

摘要:题目链接题意:给你一个数n,问最少有多少个1构成的“1”串(1,11,...)能整除n;比如:111能被3整除; 111111能被7整除;...作为水货觉得只要自己能1A的都是水题=。 = 1 #include 2 #include 3 #include 4 #include 5 using nam... 阅读全文

posted @ 2015-03-21 11:11 LLGemini 阅读(196) 评论(0) 推荐(0)

摘要:Juliano is a fan of the TV show Erasing and Winning, where participants are selected in a draw and receive money for taking part in the show.In the sh... 阅读全文

posted @ 2015-03-20 09:04 LLGemini 阅读(589) 评论(1) 推荐(0)

摘要:C++/STL中定义的next_permutation和prev_permutation函数是非常灵活且高效的一种方法,它被广泛的应用于为指定序列生成不同的排列。next_permutation函数将按字母表顺序生成给定序列的下一个较大的排列,直到整个序列为降序为止。prev_permutation... 阅读全文

posted @ 2015-03-15 11:18 LLGemini 阅读(468) 评论(0) 推荐(0)

摘要:Since ancient time, people have been dreaming of flying in the sky. Eventually, the dream was realized in the 20th century. Nowadays, the airplane bec... 阅读全文

posted @ 2015-03-15 10:58 LLGemini 阅读(180) 评论(0) 推荐(0)

摘要:Problem F: Polynomial RemainsGiven the polynomial a(x) = anxn+ ... + a1x + a0,compute the remainder r(x) when a(x) is divided by xk+1.The input c... 阅读全文

posted @ 2015-03-14 18:46 LLGemini 阅读(249) 评论(0) 推荐(0)

摘要:http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html好吧,懒死我算了 阅读全文

posted @ 2015-03-14 10:30 LLGemini 阅读(139) 评论(0) 推荐(0)

摘要:System DependenciesComponents of computer systems often have dependencies--other components that must be installed before they will function properly.... 阅读全文

posted @ 2015-03-14 10:21 LLGemini 阅读(580) 评论(0) 推荐(0)

摘要:When a student is too tired, he can't help sleeping in class, even if his favorite teacher is right here in front of him. Imagine you have a class of ... 阅读全文

posted @ 2015-03-12 19:12 LLGemini 阅读(477) 评论(0) 推荐(0)

摘要:1A~,但后来看人家的代码好像又写臭了,T^T...Problem A: Educational journeyThe University of Calgary team qualified for the 28th ACM International Collegiate Programming... 阅读全文

posted @ 2015-03-10 21:05 LLGemini 阅读(184) 评论(0) 推荐(0)

摘要:unsigned int 0~4294967295int 2147483648~2147483647unsigned long 0~4294967295long 2147483648~2147483647long long的最大值:9223372036854775807long long的最小值:-... 阅读全文

posted @ 2015-03-10 20:37 LLGemini 阅读(159) 评论(0) 推荐(0)

摘要:What is the value this simple C++ function will return? 1 long long H(int n) 2 3 { 4 long long res = 0; 5 for( int i = 1; i 2 #include 3 #includ... 阅读全文

posted @ 2015-03-10 19:32 LLGemini 阅读(179) 评论(0) 推荐(0)

摘要:Add AgainInput:Standard InputOutput:Standard OutputSummation of sequence of integers is always a common problem in Computer Science. Rather than compu... 阅读全文

posted @ 2015-03-10 17:27 LLGemini 阅读(249) 评论(0) 推荐(0)

摘要:ChessAlmost everyone knows the problem of putting eight queens on anchessboard such that no Queen can take another Queen. Jan Timman (a famous Dutch c... 阅读全文

posted @ 2015-03-09 20:44 LLGemini 阅读(363) 评论(0) 推荐(0)

摘要:Problem HHARDLY HARDYou have been given the task of cutting out a quadrilateral slice of cake out of a larger, rectangular cake. You must find the sli... 阅读全文

posted @ 2015-03-09 18:41 LLGemini 阅读(158) 评论(0) 推荐(0)

摘要:看到了大神的代码。理解了好久。。。真是差距。题意:给出m, p, a, b,然后xi满足已下两个公式, 求xp1+xp2+...+xpm的最大值。1、-1/sqrt(a) 0)2、x1+x2+...+xm = b*sqrt(a);注意:p为偶数。解题思路:因为p为偶数,所以sqrt(a)和-1/sq... 阅读全文

posted @ 2015-03-08 21:00 LLGemini 阅读(269) 评论(0) 推荐(0)

摘要:Dsecriptionn participants of «crazy tea party» sit around the table. Each minute one pair of neighbors can change their places. Find the minimum time ... 阅读全文

posted @ 2015-03-08 20:38 LLGemini 阅读(194) 评论(0) 推荐(0)

摘要:谢谢阿苏~http://blog.csdn.net/urecvbnkuhbh_54245df/article/details/5856756【迭代加深搜索(ID,iterative deepening)】:从小到大枚举上限maxd,每次执行只考虑深度不超过maxd的结点。 ------对于可以用回... 阅读全文

posted @ 2015-03-06 21:15 LLGemini 阅读(345) 评论(0) 推荐(0)

摘要:【LIC--最长递增子序列问题】 在一列数中寻找一些数,这些数满足:任意两个数a[i]和a[j],若i minT[len],则将T[t]接在minT[len]后将得到一个更长的上升子序列,len = len + 1, minT[len] = T[t];否则,在minT[1]..minT[len]中,... 阅读全文

posted @ 2015-03-05 00:00 LLGemini 阅读(365) 评论(0) 推荐(0)

摘要:判断一个字符串是否为回文串最简单的方法是从两边向中间收缩看是否字符相同。1 bool is_pali(int l, int r)2 {3 while(l < r)4 {5 if(str[l] != str[r]) return false;6 ++l;... 阅读全文

posted @ 2015-03-04 09:54 LLGemini 阅读(130) 评论(0) 推荐(0)

摘要:回文串问题。给出一个字符串,问最少可以划分为多少个字符串子串。对于判断是否为回文串,对于不是很长的字符串,可以采取直接暴力,即从两边向中间收缩判断字符相等。1 bool is_pali(int l, int r)2 {3 while(l #include#include#includeusi... 阅读全文

posted @ 2015-03-04 09:52 LLGemini 阅读(164) 评论(0) 推荐(0)

摘要:Problem FLighting SystemDesignInput: StandardInputOutput: StandardOutput You are given the task to designa lighting system for a huge conference hall.... 阅读全文

posted @ 2015-03-03 23:43 LLGemini 阅读(207) 评论(0) 推荐(0)

摘要:首先看到这题脑子里立刻跳出链表。。后来继续看如家的分析说,链表法时间复杂度为O(n*k),肯定会TLE,自己才意识到果然自个儿又头脑简单了 T^T.看如家的分析没怎么看懂,后来发现这篇自己理解起来更容易(...)共享一下~http://blog.csdn.net/chenguolinblog/art... 阅读全文

posted @ 2015-03-03 20:32 LLGemini 阅读(438) 评论(0) 推荐(0)

摘要:(memcpy)除了可以复制字符串也可以复制数组和结构体哦(接触DP开始!!!) DAG图:有向无环图(Directed Acyclic Graph) 阅读全文

posted @ 2015-03-02 23:26 LLGemini 阅读(473) 评论(0) 推荐(0)

摘要:如家大神书上的例题。第一次接触也是按代码敲得。敲的过程感觉很直观。但自己写估计会写的乱七八糟。以后不能砍得难就不愿意做这种题。否则只能做一些水题了。(PS:48)紫书 1 #include 2 #include 3 #include 4 #include 5 #include 6 using nam... 阅读全文

posted @ 2015-03-02 23:14 LLGemini 阅读(204) 评论(0) 推荐(0)

摘要:声明:也是摘自网上各路大神的。memset的正规用法是只能用来初始化char类型的数组的,也就是说,它只接受0x00-0xFF的赋值。因为char是1字节,memset是按照字节赋值的,相当于把每个字节都设为那个数,所以char型的数组可赋任意值;而对于也常用的int类型,int是4个字节,当mem... 阅读全文

posted @ 2015-03-02 20:21 LLGemini 阅读(4324) 评论(0) 推荐(1)

摘要:题意:给你一个数字n,有两种操作:减1或乘2,问最多经过几次操作能变成m;随后发篇随笔普及下memset函数的初始化问题。自己也是涨了好多姿势。代码 1 #include 2 #include 3 #include 4 #include 5 #define INF 0x7fffffff; 6 usi... 阅读全文

posted @ 2015-03-02 20:07 LLGemini 阅读(188) 评论(0) 推荐(0)

摘要:Shanghai Hypercomputers, the world's largest computer chip manufacturer, has invented a new class of nanoparticles called Amphiphilic Carbon Molecules... 阅读全文

posted @ 2015-03-02 17:46 LLGemini 阅读(449) 评论(1) 推荐(1)

摘要:atan2(y, x); atan2(y,x)所表达的意思是坐标原点为起点,指向(x,y)的射线在坐标平面上与x轴正方向之间的角的角度。 区别:atan(y/x); 返回数字的反正切值(弧度)。 阅读全文

posted @ 2015-03-02 00:15 LLGemini 阅读(148) 评论(0) 推荐(0)

摘要:In this problem, we consider a simple programming language that has only declarations of onedimensional integer arrays and assignment statements. The ... 阅读全文

posted @ 2015-03-01 00:36 LLGemini 阅读(1001) 评论(0) 推荐(0)