码迷,mamicode.com
首页 >  
搜索关键字:poj 1321    ( 20310个结果
Parity game POJ - 1733 带权并查集
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; const int N=10010<<1; struct node { int l,r,ans; } q[N]; int a[N],fa[N],d ...
分类:其他好文   时间:2020-02-01 21:18:27    阅读次数:74
Wireless Network POJ - 2236
#include<iostream> #include<cmath> using namespace std; const int N=1010; int dx[N],dy[N]; int p[N]; int repair[N]; int n; int d; double get(int a,int ...
分类:Web程序   时间:2020-02-01 16:30:31    阅读次数:97
The Suspects POJ - 1611
#include<iostream> using namespace std; const int N=30010; int n,m,ans,p[N]; int find(int x) { if(p[x]!=x) p[x]=find(p[x]); return p[x]; } int main() ...
分类:其他好文   时间:2020-02-01 16:15:56    阅读次数:50
食物链 POJ - 1182
#include<iostream> #include<cstdio> using namespace std; const int N=100010; int p[N]; int d[N]; int find(int x) { if(p[x]!=x) { int u=find(p[x]); d[x ...
分类:其他好文   时间:2020-02-01 16:15:15    阅读次数:47
POJ-3984-迷宫问题(bfs+记录路径)
定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要 ...
分类:其他好文   时间:2020-02-01 12:30:41    阅读次数:74
POJ 3069 Saruman's Army
1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<queue> 5 #include<map> 6 #include<vector> 7 #include<set> 8 #include<string> ...
分类:其他好文   时间:2020-01-31 18:49:43    阅读次数:71
poj 2823题解
这道题就是单调队列的裸题 今天刚学的单调队列 前几天刚学习完单调栈 感觉这两个东西非常相似哇 黄哥的一句话说破了他 他俩的区别就像队列和栈的区别233333 有关这道题倒没有太多说的 就是模拟队列 单调递增递减来找到区间最值 我这里用了数组模拟 问题就是G++ T了/// 而C++ AC 就很迷。。 ...
分类:其他好文   时间:2020-01-31 18:32:19    阅读次数:79
Candies POJ - 3159 差分约束
// #include<iostream> #include<cstring> #include<queue> #include<stack> #include<stdio.h> using namespace std; const int INF=0x3f3f3f3f; const int N=3 ...
分类:其他好文   时间:2020-01-31 16:01:31    阅读次数:71
POJ 1753
题目大意: 有 4x4 的正方形,每个格子要么是黑色,要么是白色,当把一个格子的颜色改变(黑 白或者白 黑)时,其周围上下左右(如果存在的话)的格子的颜色也被反转,问至少反转几个格子可以使 4x4 的正方形变为纯白或者纯黑? 下面说说自己的收获 创建结构数组比结构体里包含数组要方便 这里使用线性存储 ...
分类:其他好文   时间:2020-01-31 14:21:40    阅读次数:52
Java-POJ1013-Counterfeit Dollar
在13枚硬币中找出fake的那一个 输入:三次天平称量结果 1 package poj.ProblemSet; 2 3 import java.util.Scanner; 4 5 /* 6 我怎么觉得是贪心算法呢? 7 起初对所有硬币标记0; 8 如果是even,则两边所有的硬币记为真(记233); ...
分类:编程语言   时间:2020-01-31 14:20:15    阅读次数:74
20310条   上一页 1 ... 37 38 39 40 41 ... 2031 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!