题意:给定一棵树n个节点m个询问,每次询问两个节点之间的距离。
思路:Tarjan离线算法求lca。
这题一开始交了n发一直爆栈.......百度了一下大概说的是这样hdu用的是windows服务器所以栈大小极其坑爹,稍微深一点的递归就会爆栈(正式比赛一般不会爆)
解决方法就是加一句#pragma comment(linker, "/STACK:1024000000,1024000000")...
分类:
编程语言 时间:
2015-08-03 17:03:23
阅读次数:
155
题目链接:点击打开链接
题目大意:有n种零件,已知每种零件的加工时间最少为3天最多为9天,现在只知道有m个工程用的时间和加工的零件数,问可不可以求出每种零件的加工时间。
列出对7取余的m个方程,用高斯消元判断是否有解,并解出来。
#include
#include
#include
using namespace std ;
#pragma comment(linker,"/STACK...
分类:
其他好文 时间:
2015-08-03 14:32:46
阅读次数:
140
一、继承关系、遵守协议、隶属框架及可用平台UIStackView 类提供了一个高效的接口用于平铺一行或一列的视图组合。Stack视图使你依靠自动布局的能力,创建用户接口使得可以动态的调整设备朝向、屏幕尺寸及任何可用范围内的变化。Stack视图管理着所有在它的 arrangedSubviews 属性中...
分类:
移动开发 时间:
2015-08-02 23:02:15
阅读次数:
199
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top()...
分类:
其他好文 时间:
2015-08-02 21:24:47
阅读次数:
121
#include#include#includetypedef struct _stack{ int* arr; int top, size;}stack;stack createStack(int size){ stack st; st.arr = (int*)malloc(size*sizeof...
分类:
其他好文 时间:
2015-08-02 19:45:41
阅读次数:
108
1、下载 Apache 官网地址:http://httpd.apache.org/docs/current/platform/windows.html#down 找到这个, 看到这几个选项: ApacheHaus Apache Lounge BitNami WAMP Stack ...
代码:#include
#include
using namespace std;
int n,m;
int mat[105][105];
int in[105];
int Stack[105],top;
void topo()
{
top=0;
for(int i=0; i<n; i++)
{
if(in[i]==0)
{
...
分类:
其他好文 时间:
2015-08-02 16:56:26
阅读次数:
122
用栈实现队列
leetcode :
Implement Queue using Stacks
Implement the following operations of a queue using stacks.
push(x) -- Push element x to the back of queue.pop() -- Removes the element ...
分类:
其他好文 时间:
2015-08-02 16:53:21
阅读次数:
141
Preface:翻译水平渣,阅读需仔细。有错误欢迎指正。What is the difference between a thread and a process?
线程和进程之间有何区别?Processes vs Threads
进程VS线程A process is an executing instance of an application. What does that mean? We...
分类:
其他好文 时间:
2015-08-02 13:45:59
阅读次数:
100
测试用例:import java.util.Stack;/* * 简单的栈类测试; * Stack继承自Vector向量类; * 所以Stack的使用和Vector的使用类型的 * 而且是线程安全的; */public class test_Stack { public static void...
分类:
编程语言 时间:
2015-08-02 13:19:04
阅读次数:
190