- 博客(22)
- 收藏
- 关注
原创 poj2449 第k短路....A*+最短路
Description“Good man never makes girls wait or breaks an appointment!” said the mandarin duck father. Softly touching his little ducks’ head, he told them a story. “Prince Remmarguts lives in his kingd
2016-11-29 14:48:25 661
原创 poj3255 次短路裸题
Description Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along
2016-11-28 20:37:35 311
原创 HDU5521 双向最短路+优先队列优化
Description Bessie and her friend Elsie decide to have a meeting. However, after Farmer John decorated his fences they were separated into different blocks. John’s farm are divided into blocks labe
2016-11-26 23:53:22 468
原创 poj3411 弱智搜索WA一下午....
再用邻接矩阵存图直播吃屎的#include<iostream>#include<cmath>#include<string>#include<queue>#include<stack>#include<cstring>#include<vector>using namespace std;int gaga=0x3f3f3f3f;int n,m,zouguo[11];vector<
2016-11-21 17:53:15 608
原创 HDU5668 中国剩余定理+约瑟夫环
Description Satiya August is in charge of souls. He finds souls,and lets them become a circle.He ordered them to play Joseph Games.The souls will count off from the soul .The soul who is numbered wi
2016-11-16 20:06:40 684
原创 poj 1006 剩余定理
无脑套板子…. 好像不需要理解什么意思的样子…. 具体就是知道余数(除数积/当前)(除数积/当前 mod当前的逆元)求和…. 就可以了… 板子有学长写好的…#include<iostream>#include<algorithm>#include<cmath>#include<string>#include<cstdio>using namespace std;long l
2016-11-14 16:23:41 397
原创 HDU4828 卡特兰数+逆元
Description 度度熊最近很喜欢玩游戏。这一天他在纸上画了一个2行N列的长方形格子。他想把1到2N这些数依次放进去,但是为了使格子看起来优美,他想找到使每行每列都递增的方案。不过画了很久,他发现方案数实在是太多了。度度熊想知道,有多少种放数字的方法能满足上面的条件? Input 第一行为数据组数T(1<=T<=100000)。 然后T行,每行为一个数N(1<=N<=10
2016-11-14 14:20:35 423
原创 lightoj 1033 区间dp
By definition palindrome is a string which is not changed when reversed. “MADAM” is a nice example of palindrome. It is an easy job to test whether a given string is a palindrome or not. But it may not
2016-11-14 13:36:34 213
原创 HDU5667 矩阵快速幂
题目给了个公式是相乘的 这个玩意一看就只能快速幂 毕竟10^18…递推瞬间爆炸 然后快速幂也能看出来 相乘的没法搞 那就log 完成然后不停的tle…. 在求出指数的时候…再用个费马小定理 要不然就gg#include<stdio.h>#include<math.h>#include<iostream>#include<string.h>#include<queue>#in
2016-11-13 12:46:53 435
原创 HDU5584 证明题..
Description A frog has just learned some number theory, and can’t wait to show his ability to his girlfriend. Now the frog is sitting on a grid map of infinite rows and columns. Rows are numbered 1, 2
2016-11-12 20:45:08 394
原创 poj 1061 扩展GCD
Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为
2016-11-12 12:21:13 335
原创 HDU5685 乘法逆元应用
Description 度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串。现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的哈希值。一个字符串的哈希值,由以下公式计算得到: 代表 S[i] 字符的 ASCII 码。 请帮助度熊计算大字符串中任意一段的哈希值是多少。 Input 多组测试数据,每组测试数据第一行是一个正整数,代表询问的
2016-11-12 08:41:57 416
原创 poj 2377
超级水题 最近真是到了奇怪的时期 弱智题做起来没意思而且不涨水平…. 难题几天又做不出来…. 感觉自己渐渐变成了智障……#include<iostream>#include<cmath>#include<cstdio>#include<string>#include<vector>#include<algorithm>#include<queue>#include<cstrin
2016-11-09 19:53:08 324
原创 lightoj 1032 数位dp
A bit is a binary digit, taking a logical value of either 1 or 0 (also referred to as “true” or “false” respectively). And every decimal number has a binary representation which is actually a series of
2016-11-08 16:52:45 350
原创 lightoj 1031 被区间dp虐哭...看题解才学会
You are playing a two player game. Initially there are n integer numbers in an array and player A and B get chance to take them alternatively. Each player can take one or more numbers from the left or
2016-11-06 01:17:08 2723
原创 lightoj 1030 水概率
You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you throw a perfect 6 si
2016-11-05 11:07:17 420
原创 lightoj 1029 生成树裸题
A Civil Engineer is given a task to connect n houses with the main electric power station directly or indirectly. The Govt has given him permission to connect exactly n wires to connect all of them. Ea
2016-11-04 22:23:41 267
原创 lightoj 1028 xjb组合
We know what a base of a number is and what the properties are. For example, we use decimal number system, where the base is 10 and we use the symbols - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. But in different
2016-11-04 20:53:29 685 1
原创 lightoj 1027 幼儿园概率...
#include<iostream>#include<cmath>#include<cstdio>#include<algorithm>#include<string>#include<memory.h>using namespace std;int gcd(int a, int b){ if (b == 0) return a; return gcd(b, a%b)
2016-11-02 23:57:31 464
原创 lightoj 1025 弱智区间dp
Feuzem is an unemployed computer scientist who spends his days working at odd-jobs. While on the job he always manages to find algorithmic problems within mundane aspects of everyday life.Today, while
2016-11-02 20:42:20 351
原创 lightoj 1009 二分染色
The Vampires and Lykans are fighting each other to death. The war has become so fierce that, none knows who will win. The humans want to know who will survive finally. But humans are afraid of going to
2016-11-02 13:03:58 234
原创 HDU4417 主席树入门2
Description Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Mario needs to save his lover. We regard
2016-11-01 20:10:00 417
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人