2014年7月19日

摘要: 样题简易的意思就是N盏灯,K个人去关。第K个人只会按下和K成倍数的开关,最后问那几盏灯开着。题目不难,但是代码里一些技巧很好:#includemain(){int n,i,k,j,m,first=1;int a[1008]={0};scanf("%d%d",&m,&n);for(i=1;i<=n;i... 阅读全文

posted @ 2014-07-19 14:21 alexanderone 阅读(108) 评论(0) 推荐(0) 编辑

摘要: D -Mutiples on a circleTime Limit:1000MSMemory Limit:65535KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionTom has a necklace with n jewels. Ther... 阅读全文

posted @ 2014-07-19 14:09 alexanderone 阅读(233) 评论(0) 推荐(0) 编辑


2014年7月18日

摘要: polyomino is a plane geometric figure formed by joining one or more equal squares edge to edge.- WikipediaGiven a large polyomino and a small polyomin... 阅读全文

posted @ 2014-07-18 16:58 alexanderone 阅读(132) 评论(1) 推荐(0) 编辑

摘要: Counting Game There are n people standing in a line, playing a famous game called ``counting". When the game begins, the leftmost person says ``1" lo... 阅读全文

posted @ 2014-07-18 15:02 alexanderone 阅读(219) 评论(1) 推荐(0) 编辑


2014年7月16日

摘要: For each test case, the first line contains a single integern(1 #includeusing namespace std;void qsort(int left ,int right, long long a[]){ int i ,... 阅读全文

posted @ 2014-07-16 14:37 alexanderone 阅读(116) 评论(0) 推荐(0) 编辑


2014年7月15日

摘要: #includemain(){int i,l,n,m,q,p,y,I,sum,t,T;int x[2010];int z[2010];scanf("%d",&n);for(i=1;i0){ l=l-t; t=t-1; T++;}l=l+t;l=l+T;if(sum==x[1]){T... 阅读全文

posted @ 2014-07-15 16:41 alexanderone 阅读(123) 评论(0) 推荐(0) 编辑

摘要: 懒得自己慢慢写了,摘录如下,感谢原作者:(1)算法的基本思想:利用矩阵对角原理来实现当字符匹配的时候,不是简单的给相应元素赋上1,而是赋上其左上角元素的值加一。我们用两个标记变量来标记矩阵中值最大的元素的位置,在矩阵生成的过程中来判断当前生成的元素的值是不是最大的,据此来改变标记变量的值,那么到矩阵... 阅读全文

posted @ 2014-07-15 09:40 alexanderone 阅读(283) 评论(0) 推荐(0) 编辑


Copyright © 2024 alexanderone
Powered by .NET 8.0 on Kubernetes