摘要:
题意:有一群牛, a会认为b很帅, 且这种认为是传递的. 问有多少头牛被其他所有牛认为很帅~思路:关键就是分析出缩点之后的有向树只能有一个叶子节点(出度为0).做法就是Tarjan之后缩点统计出度. #include #include #include #include using namespace std;const int MAXN = 10005;const int MAXE = 50005;struct pool{ int v,pre;}p[MAXE];int num,head[MAXN];int dfn[MAXN],low[MAXN],id[MAXN],dag[MAXN];b...
阅读全文
posted @ 2013-08-19 19:26
风言枫语
阅读(139)
推荐(0)
摘要:
题意:有n个区域布局,每个区域有一些金矿,挖开金矿需要一定的费用,可以得到一定的利润,要想挖开一个金矿,必须挖开所有在这个金矿上边的金矿,求最大利益,给的数据价值太大,用64位。分析:如果一个金矿可以获利,就从源点引一条边,容量为获得的利益,否则向汇点引一条边,容量为损耗,一个金矿向所有的必须在它之前开发的金矿连边,容量为无穷大。求出最大流就是最小损耗,,, #include#includeconst int N=2600;const __int64 inf=0x3fffffffffffffff;int dis[N],gap[N],head[N],num,start,end,ans;...
阅读全文
posted @ 2013-08-19 19:24
风言枫语
阅读(302)
推荐(0)
摘要:
改了好久,上午来实验室打出来了,运行就是不对,一直找啊找!还是没找到,最后突然停电了,打好的代码还没保存呢!刚才来的时候又重新打了一遍!!!结果一个小小的错误wrong了好久!!!在dfs值返回时两个NO的返回值不同写错了一个-100,一个-10,肯定不对了!!嘿嘿····,找到了,改了,提交了!对了!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#include#include #include using namespace std; struct node { int
阅读全文
posted @ 2013-08-19 19:22
风言枫语
阅读(154)
推荐(0)
摘要:
自己写sqlhelper类using System;using System.Collections.Generic;using System.Configuration;using System.Data;using System.Data.SqlClient;using System.Linq;using System.Text;namespace birthday{ /// /// SqlHelper /// [Serializable] public class SqlHelper { //数据库连接字符串 priva...
阅读全文
posted @ 2013-08-19 19:19
风言枫语
阅读(172)
推荐(0)
摘要:
1. 配一个Samba,service运行都正常,但就是无法访问。。。。那个郁闷啊。。。。 后发现,原来该系统是在路由上做端口映射的方式访问的,IP为路由的IP。 解决方法:直接把该服务器挂到交换机上,不经过该路由,修改网络,直接访问;
阅读全文
posted @ 2013-08-19 19:17
风言枫语
阅读(111)
推荐(0)
摘要:
linux定时器 原文出自http://www.cnblogs.com/processakai/archive/2012/04/11/2442294.html今天看书看到了关于alarm的一些用法,自己有在网上找了些资料看了下; 1。alarm()执行后,进程将继续执行,在后期(alarm以后)的执行过程中将会在seconds秒后收到信号SIGALRM并执行其处理函数。#include #include #include void sigalrm_fn(int sig) { printf("alarm!\n"); alarm(2); return; } int main(v
阅读全文
posted @ 2013-08-19 19:15
风言枫语
阅读(292)
推荐(0)
摘要:
package com.test.test2;public class FFT { public static final int FFT_N_LOG = 10; // FFT_N_LOG > 1]; costable = new float[FFT_N >> 1]; bitReverse = new int[FFT_N]; int i, j, k, reve; for (i = 0; i >>= 1; } bitReverse[i] = reve; } double theta, dt = 2 * 3.14159265358979323846 / FFT_N;
阅读全文
posted @ 2013-08-19 19:13
风言枫语
阅读(1057)
推荐(0)
摘要:
Question 1: --------------------------------------------------------------------------------------- 写一个函数 把传入的数组倒置 可以用任何编程语言 不能用现有函数,除了coun或者size之类的基本操作 Question 2: --------------------------------------------------------------------------------------- In database XYZ, there's a table 'run_k
阅读全文
posted @ 2013-08-19 19:10
风言枫语
阅读(185)
推荐(0)
摘要:
/*博弈关键态:较大数是较小数的2倍以上。*/#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long int64;//typedef __int64 int64;typedef pair PII;#define MP(a,b) make_pair((a),(b)) const int maxn = 1005;const int inf = 0x7fffffff;const double pi=acos(-1.0);c
阅读全文
posted @ 2013-08-19 19:08
风言枫语
阅读(130)
推荐(0)
摘要:
一个集合x有都不相同的n个元素,使用这个集合中的不定个数的元素,组成一个和为s的序列,求出所有符合的序列,元素可以重复使用,只要元素的个数相同不考虑顺序。比如集合是x={2,3,4,5,7}; n=5, s=12可以得出以下的序列:2 2 2 2 2 2 2 2 2 2 4 2 2 2 3 3 2 2 3 5 2 2 4 4 2 3 3 4 2 3 7 2 5 5 3 3 3 3 3 4 5 4 4 ...
阅读全文
posted @ 2013-08-19 19:06
风言枫语
阅读(143)
推荐(0)