题目大意:给一个无向图,有些点有装监视器记录第一次到达该点的位置,问是否存在一条路径使得监视器以给定的顺序响起,并且经过所有点思路:牡丹江网络赛的题,当时想了种并查集的做法,通神写完程序WA了几发,此时JYB用BFS秒了,索性最后还是调出来了,今天自己写了下,感觉唯一的坑点就是需要遍历完所有的点//...
分类:
其他好文 时间:
2014-11-21 23:12:13
阅读次数:
309
6-07. 哈利·波特的考试(25) (ZJU_PAT Floyd)...
分类:
其他好文 时间:
2014-11-21 21:57:35
阅读次数:
462
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3574
题意:一个坐标系,给出x1、x2限定左右边界,有n条直线,告诉每条直线的k和b,问在x1、x2区间内空间被直线分割成几部分
思路:
这道题是比赛时做的,AC之后发现别人都是用归并排序求逆序对数来解的。
说我的解法吧,首先拿到题的时候发现是划分...
分类:
其他好文 时间:
2014-11-21 01:44:38
阅读次数:
390
#include #include using namespace std;int getO(string str,int &start,char ch){ int count=0; for(;start>str) { //char c = str.at(1); ...
分类:
其他好文 时间:
2014-11-20 23:25:07
阅读次数:
238
??
Description
Battle Ships is a new game which is similar to Star Craft. In this game, the enemy builds a defense tower, which has L longevity. The player has a military factory, which can
...
分类:
其他好文 时间:
2014-11-19 22:26:25
阅读次数:
316
Simple calculations
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 6559
Accepted: 3291
Description
There is a sequence of n+2 elements a0, a1, ..., an+1...
分类:
其他好文 时间:
2014-11-19 22:21:23
阅读次数:
197
Mine Sweeper
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 6429
Accepted: 2500
Description
The game Minesweeper is played on an n by n grid. In this gr...
分类:
其他好文 时间:
2014-11-19 22:17:09
阅读次数:
224
很简单的概率题了设dp[x]为能力值 为x时出去的期望 天数#include #include #include #include #include using namespace std;double dp[20005];int ci[125];double is=0.5*(1+sqrt(5));...
分类:
其他好文 时间:
2014-11-19 21:47:56
阅读次数:
158
Martian Addition
Time Limit: 2 Seconds Memory Limit: 65536 KB
In the 22nd Century, scientists have discovered intelligent residents live on the Mars. Martians are very fond of mathematics...
分类:
其他好文 时间:
2014-11-19 20:39:08
阅读次数:
205
///给你n 求他能分解成多少个的不同的k个素数相加之和
///01背包,素数打表
# include
# include
# include
# include
# include
using namespace std;
int cot;
int used[1500];
int prime[1500];
void sushu()///素数打表
{
memset(used,0,...
分类:
其他好文 时间:
2014-11-19 20:36:45
阅读次数:
299