知识点&&题目
文章平均质量分 76
一只会冒泡的猫
不是一个人的努力
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
并查集运用
来点心得体会吧!intFind(int x){ return x==fa[x]?x:fa[x]=Find(fa[x]);}voidmerger(int a,int b){ int r1 = Find(a); int r2 = Find(b); /*if(r1!=r2){ Fa[r1]=r2;} */原创 2017-04-27 21:17:54 · 503 阅读 · 0 评论 -
同余定理的应用
Problem DescriptionTwo planets named Haha and Xixi in the universe and they were created with the universe beginning.There is 73 days in Xixi a year and 137 days in Haha a year. Now you kn原创 2017-05-06 17:01:01 · 522 阅读 · 0 评论 -
EOJ----连续正整数之和
我们可以知到从i开始连续k个数之和的计算公式如下: sum = k * (2 * i + k - 1) / 2;在题目要求sum == num 的所有可能情况,上面的解法是从起始位置开始循环,又根据连续个数循环,这样需要两重循环。但如果我们根据上面的公式逆向想想,如果sum==num时,i与k的关系等式为k * (2 * i + k原创 2017-05-23 20:57:40 · 1887 阅读 · 0 评论 -
poj----Wormholes
#include#include#includeusing namespace std;const int maxx=99999999;int t,n,m,l,k;struct A{ int s,e,v;} f[5205];int dis[505];bool bellman_ford(){ bool flag; int i=0; memset(原创 2017-04-30 17:54:36 · 316 阅读 · 0 评论 -
Wormholes
While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that i原创 2017-04-30 15:06:28 · 378 阅读 · 0 评论 -
时钟夹角
Clock题目描述钟的一圈是12小时,其中时针、分钟都是匀速移动。一天从00:00~23:59,请问某一时刻,时针与分针的夹角是多少? 输入第一行是一个整数T(1≤T≤1440),表示样例的个数。以后每行是一个时刻,格式为HH:MM。输出每行输出一个样例的结果,如果结果不是整数,小数部分不要输出多余的0。样例输入200:0100:30样例输原创 2017-04-18 17:10:41 · 1547 阅读 · 0 评论 -
White Rectangles
You are given a chessboard made up of N squares by N squares with equal size. Some of the squares are colored black, and the others are colored white. Please write a program to calculate the number原创 2017-04-18 21:06:20 · 644 阅读 · 0 评论 -
Modular Inverse
The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 (mod m).InputThere are multiple test cases. The first line原创 2017-04-20 18:31:50 · 500 阅读 · 0 评论 -
青蛙的约会
两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,原创 2017-04-21 15:13:26 · 400 阅读 · 0 评论 -
Romantic(扩展欧几里得)
The Sky is Sprite.The Birds is Fly in the Sky.The Wind is Wonderful.Blew Throw the TreesTrees are Shaking, Leaves are Falling.Lovers Walk passing, and so are You. .........................原创 2017-04-21 16:06:05 · 339 阅读 · 0 评论 -
第几是谁?
第几是谁?时间限制:3000 ms | 内存限制:65535 KB难度:3描述现在有"abcdefghijkl”12个字符,将其按字典序排列,如果给出任意一种排列,我们能说出这个排列在所有的排列中是第几小的。但是现在我们给出它是第几小,需要你求出它所代表的序列.输入第一行有一个整数n(0随后有n行,每行是一个整数m,它代表着序列的第几小;输出原创 2017-04-21 20:15:15 · 284 阅读 · 0 评论 -
我排第几个
我排第几个时间限制:1000 ms | 内存限制:65535 KB难度:3描述现在有"abcdefghijkl”12个字符,将其所有的排列中按字典序排列,给出任意一种排列,说出这个排列在所有的排列中是第几小的?输入第一行有一个整数n(0随后有n行,每行是一个排列;输出输出一个整数m,占一行,m表示排列是第几位;直接上康原创 2017-04-21 19:59:35 · 246 阅读 · 0 评论 -
poj------Questions
Holding a collegiate programming contest is a very exhausting work. There is a well-known proverb that one fool can ask so many questions that a hundred clever men will not answer. And during a colleg原创 2017-04-29 19:57:18 · 373 阅读 · 0 评论 -
最长对称子串
最长对称子串:给出一个字符串,求出它的最长的对称的子串的长度#include#include#include#include#includeusingnamespace std;intmain(){ string str; int max,maxx=1; getline(cin,str); int len=str.leng原创 2017-04-27 21:09:48 · 402 阅读 · 0 评论 -
CDOJ-----最长上升子序列
G - 最长上升子序列Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)Submit Status一个数的序列B=(b1,b2,⋯,bS)B=(b1,b2,⋯,bS),当b1b2⋯bSb1 的时候,我们称这个序列是上升的。对于给定的原创 2017-05-31 12:23:18 · 579 阅读 · 0 评论
分享