码迷,mamicode.com
首页 >  
搜索关键字:题意    ( 33207个结果
SGU 145.Strange People
时间:0.25s空间:4m题意: 其实就是求无环第K短路。 输入: 给出n,m,k,分别代表,n个点,m条边,第k长路。 接下来m行,三个整数x,y,z,分别代表x,y之间有条费用为x的双向路。保证没有重边。输出: 第一行两个数a,b,第k小费用a,和经过的点的...
分类:其他好文   时间:2014-07-16 19:31:00    阅读次数:179
SGU 146.The Runner
时间限制:0.25s空间限制:4M题意: 一个人在一个周长为L的圆上跑,每个时间段(Ti)的速度(Vi)不一样,问最后他离起点的圆弧距离,周长是个有四位小数的浮点数,其它全是整数。Solution : 在遇到浮点数的时候,能避免处理就尽量避免处理。 这里只要将浮点数乘上1000...
分类:其他好文   时间:2014-07-15 23:20:50    阅读次数:328
UVa10340
All in All题意:字符串匹配#include #include char S[200000];char P[200000];int next[200000];int KMP(int pos, int len1, int len2){ int i = pos, j = 1, k = 0;...
分类:其他好文   时间:2014-07-13 20:09:39    阅读次数:175
UVa539
The Settlers of Catan题意:求最长路径#include #include int maxstep;int s[100][100];int n, m;void dfs(int v, int c){ int i; if(maxstep < c) maxste...
分类:其他好文   时间:2014-07-13 20:05:02    阅读次数:181
UVa439
Knight Moves题意:骑士巡游到某位置的最少步数#include #include int s[20][20];int rear, front;int min;char a, c;int b, d;struct{ int x, y; int p;}Susake[300000];v...
分类:其他好文   时间:2014-07-13 20:04:24    阅读次数:231
UVa10954
Add All题意:最优二叉树(priority_queue实现)#include #include #include using namespace std;int main(int argc, char *argv[]){ int n, i, j, a, sum[6000]; pri...
分类:其他好文   时间:2014-07-13 20:03:13    阅读次数:218
UVa673
Parentheses Balance题意:括号匹配#include #include int main(int argc, char *argv[]){ char ch, stack[200]; int i = 0, flag = 0, n, j; scanf("%d%*c", ...
分类:其他好文   时间:2014-07-13 20:01:12    阅读次数:195
2014 Super Training #8 A Gears --并查集
题意:有N个齿轮,三种操作1.操作L x y:把齿轮x,y链接,若x,y已经属于某个齿轮组中,则这两组也会合并。2.操作Q x y:询问x,y旋转方向是否相同(等价于齿轮x,y的相对距离的奇偶性)。3.操作D x :拆下齿轮x,并且x所在的齿轮组不会断开4.操作S x : 查询齿轮x所在的齿轮组有....
分类:其他好文   时间:2014-07-13 19:43:22    阅读次数:191
A strange lift
点击打开链接 题意:有n层楼层,现在在每一层有两个按钮,分别为up和down,按动按钮时,可以向上或向下跳动num[ i ]层;问能否以最少的次数从A到B层,不能输出-1; 解析:构图,将从i层到按动按钮后跳转的楼层,看作连通状态,赋值为1,这样就转换成单源最短路问题; #include #include #include using namespace std; const int m...
分类:其他好文   时间:2014-07-13 18:37:00    阅读次数:231
Light OJ 1411 Rip Van Winkle`s Code 线段树成段更新
题目来源:Light OJ 1411 Rip Van Winkle`s Code 题意:3中操作 1种查询 求区间和 其中每次可以把一段区间从左到右加上1,2,3,。。。或者从右到左加上。。。3,2,1 或者把某个区间的数都置为v 思路:我是加了6个域  add是这段区间每个数都要加上add  add是这么来的 对与123456。。。这个等差数列 可能要分为2个区间 那么我就分成123和12...
分类:Windows程序   时间:2014-07-13 18:04:35    阅读次数:320
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!