car = $car; } public function run(){ $this->car->run(); echo '高速公路上行驶'; }}class street extends road{ public $car; public function __construct($car...
分类:
Web程序 时间:
2014-11-05 12:33:18
阅读次数:
223
Description
The official capital and the cultural capital of Berland are connected by a single road running through n regions. Each region has a unique climate, so the i-th (1?≤?i?≤?n) region
has...
分类:
其他好文 时间:
2014-11-04 17:33:03
阅读次数:
169
Qin Shi Huang's National Road SystemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) 【Problem Description】During the Wa...
分类:
其他好文 时间:
2014-11-04 17:02:01
阅读次数:
268
本方法模拟了现实生活中的交通信号灯的情况1.先构建Road类,此类可以创建12个方向的路代码如下: 1 package com.springtie.traffic; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 import ....
分类:
编程语言 时间:
2014-10-28 23:47:20
阅读次数:
298
find the safest roadTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6973Accepted Submission(s): 2...
分类:
其他好文 时间:
2014-10-26 11:39:18
阅读次数:
198
2014/10/26:BZOJ2752 [HAOI2012]高速公路(road) --线段树,操作太烦了的说。。。BZOJ1020 [SHOI2008]安全的航线flight --二逼计算几何T TBZOJ1013 [JSOI2008]球形空间产生器sphere --貌似是高斯消元?BZOJ1033...
分类:
其他好文 时间:
2014-10-26 10:13:14
阅读次数:
173
POJ 3177 Redundant Paths
题目链接
题意:给定一个连通无向图,问加几条边能使得图变成一个双连通图
思路:先求双连通,缩点后,计算入度为1的个数,然后(个数 + 1) / 2 就是答案(这题由于是只有一个连通块所以可以这么搞,如果有多个,就不能这样搞了)
代码:
#include
#include
#include
using namesp...
分类:
其他好文 时间:
2014-10-24 10:58:00
阅读次数:
108
1.We are what we repeatedly do. Excellence, then, is not an act, but a habit.————我们重复做什么,就会成为什么样的人。优秀不是一个行为,而是一个习惯!2.On the road, is often the most no...
分类:
其他好文 时间:
2014-10-22 10:44:57
阅读次数:
204
UVA1455 - Kingdom(并查集 + 线段树)
题目链接
题目大意:一个平面内,给你n个整数点,两种类型的操作:road x y 把city x 和city y连接起来,line fnum (浮点数小数点一定是0.5) 查询y = fnum这条直线穿过了多少个州和city。州指的是连通的城市。
解题思路:用并查集记录城市之间是否连通,还有每个州的y的上下界。建立坐标y的...
分类:
其他好文 时间:
2014-10-21 12:18:47
阅读次数:
176
模板题,唯一问题是当长度为1是,road是单数,不然road是复数roads。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn=1021000;
struct node
{
int r;
int b...
分类:
其他好文 时间:
2014-10-19 17:07:26
阅读次数:
206