题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1787
题解:
求出三个点两两之间的lca会发现有两个是一样的,然后我们选那个不一样的就好了。
#include
#include
#include
#include
using namespace std;
struct use{
int st,en;
}b[5000001];...
分类:
其他 时间:
2015-05-25 22:36:17
收藏:
0 评论:
0 赞:
0 阅读:
263
3304 水果姐逛水果街Ⅰ时间限制: 2 s
空间限制: 256000 KB
题目等级 : 钻石 Diamond
题目描述 Description 水果姐今天心情不错,来到了水果街。
水果街有n家水果店,呈直线结构,编号为1~n,每家店能买水果也能卖水果,并且同一家店卖与买的价格一样。
学过oi的水果姐迅速发现了一个赚钱的方法:在某家水果店买一个水果,再到另外一家店卖出去,赚差价。...
分类:
其他 时间:
2015-05-25 22:36:07
收藏:
0 评论:
0 赞:
0 阅读:
307
暴力法枚举,五重循环。
一开始因为空格问题WA了,要注意#include
#include
#include
using namespace std;int main(){
int a,b,c,d,e,f,g,h,i,j,n;
int cnt = 0;
int div = 0,res;
set num;...
分类:
其他 时间:
2015-05-25 22:35:27
收藏:
0 评论:
0 赞:
0 阅读:
276
类似于背包,但是最后物品可以拆分.另外,因为要求第一次的选择,从后往前进行dp.代码如下:#include
#include
#include
using namespace std;#define INF 0x3f3f3f3ftypedef struct
{
int cnt;
int w[103],v[103];
}P;
P...
分类:
其他 时间:
2015-05-25 22:35:07
收藏:
0 评论:
0 赞:
0 阅读:
240
字符串统计
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 51785 Accepted Submission(s): 28416
Problem Description
对于给定的一个字符串,统计其中数字字符出现的...
分类:
其他 时间:
2015-05-25 22:34:57
收藏:
0 评论:
0 赞:
0 阅读:
296
2753: [SCOI2012]滑雪与时间胶囊
Time Limit: 50 Sec Memory Limit: 128 MB
Submit: 1524 Solved: 536
[Submit][Status][Discuss]
Description
a180285非常喜欢滑雪。他来到一座雪山,这里分布着M条供滑行的轨道和N个轨道之间的交点(同时也是景点),而且每个景点都有一编号i(...
分类:
其他 时间:
2015-05-25 22:34:48
收藏:
0 评论:
0 赞:
0 阅读:
201
3305 水果姐逛水果街Ⅱ 时间限制: 2 s
空间限制: 256000 KB
题目等级 : 钻石 Diamond
题目描述 Description水果姐第二天心情也很不错,又来逛水果街。
突然,cgh又出现了。cgh施展了魔法,水果街变成了树结构(店与店之间只有一条唯一的路径)。
同样还是n家水果店,编号为1~n,每家店能买水果也能卖水果,并且同一家店卖与买的价格一样。
cgh给出m个问题,每...
分类:
其他 时间:
2015-05-25 22:34:27
收藏:
0 评论:
0 赞:
0 阅读:
381
Distance Queries
Time Limit: 2000MS
Memory Limit: 30000K
Total Submissions: 10142
Accepted: 3575
Case Time Limit: 1000MS
Description
Farmer John's cows refused to ...
分类:
其他 时间:
2015-05-25 22:34:07
收藏:
0 评论:
0 赞:
0 阅读:
217
BZOJ 3196 二逼平衡树 树套树...
分类:
其他 时间:
2015-05-25 22:33:57
收藏:
0 评论:
0 赞:
0 阅读:
537
对于仿射变换的理解,以本人现阶段水平还谈不上是深入了解,我喜欢把它想象成一种简单的动画效果,下面介绍几种简单的变化:位置移动,按一定比例缩放,顺时针、逆时针旋转
#import "ViewController.h"
@interface
ViewController ()
@property (nonatomic...
分类:
其他 时间:
2015-05-25 22:33:47
收藏:
0 评论:
0 赞:
0 阅读:
325
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
["aa","...
分类:
其他 时间:
2015-05-25 22:33:37
收藏:
0 评论:
0 赞:
0 阅读:
259
Perl 是 Practical Extraction and Report Language的缩写,它是由Larry Wall设计的,并由他不断更新和维护。
Perl 是解释运行的。一般Perl程序的第一行需注明自己是个Perl程序而不是shell程序
。
一般将下面的一行作为文件的第一行#!/usr/bin/perl可以在终端敲入 prel -v 查看是否有安装prel 。 wher...
分类:
其他 时间:
2015-05-25 22:33:07
收藏:
0 评论:
0 赞:
0 阅读:
290
毕业设计终于忙完了,答辩顺利通过~~~以后可以安心的写程序了,希望正在学习IOS或者编程的道友能一起学习,本人会不定时上传案例demo,愿你我共勉,一起学习进步。最后一句,每个人都要有梦想,万一实现了呢~~~...
分类:
其他 时间:
2015-05-25 22:32:51
收藏:
0 评论:
0 赞:
0 阅读:
292
题意不说了,之所以贴代码是因为想说容器是个很好的东西#include
#include
#include
#include
#include
#include
using namespace std;
mapint,setint> >mp;
setint>::iterator it;
int main()
{
int n,m,x;
while(~scanf("%d%d",&n,&m...
分类:
其他 时间:
2015-05-25 22:32:17
收藏:
0 评论:
0 赞:
0 阅读:
350
3306 水果姐逛水果街Ⅲ 时间限制: 2 s
空间限制: 256000 KB
题目等级 : 大师 Master
题目描述 Description连续两天都没有被cgh难倒,水果姐心情很不错,第三天又来逛水果街。
今天cgh早早就来到了水果街等水果姐,因为他带来了帮手cys。cgh的魔法是把水果街变成树结构,而cys的魔法是瞬间改变某家店的水果价格。一边问一边改,绝不给水果姐思考的时间!
同样还...
分类:
其他 时间:
2015-05-25 22:32:07
收藏:
0 评论:
0 赞:
0 阅读:
330
dp[i][j]dp[i][j]表示时刻i,在车站j,等待的最少时间
有3中方案:
等一分钟
往左搭车
往右搭车/*************************************************************************
> File Name: uva1025.cpp
> Author: ALex
> Mail: zchao1...
分类:
其他 时间:
2015-05-25 22:31:57
收藏:
0 评论:
0 赞:
0 阅读:
325
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1107
#include
#include
#include
#include
using namespace std;
const int maxn=2000+10;
typedef struct Node
{
int x,y;
int level,in,out,lift;//门...
分类:
其他 时间:
2015-05-25 22:31:55
收藏:
0 评论:
0 赞:
0 阅读:
279
小希的迷宫
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 31911 Accepted Submission(s): 9850
Problem Description
上次Gardon的迷宫城堡小希玩了很久(见Pr...
分类:
其他 时间:
2015-05-25 22:31:53
收藏:
0 评论:
0 赞:
0 阅读:
186
基于域名的7层转发的实现(NAT+反向代理)
在实际办公网中,因为出口IP只有一个,要实现对外提供服务的话就必须得做端口映射,如果有多个服务要对外开放的话,这只能通过映射不同端口来区分,这在实际使用过程中非常的痛苦(记忆困难、一一对应关系也没有规律、访问的时候还得加端口),这个痛苦的问题用表格的形式来形象的描述如下:
Public IP
Pub...
分类:
其他 时间:
2015-05-25 22:31:28
收藏:
0 评论:
0 赞:
0 阅读:
548
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1688
题意:求最短路和次短路条数如果次短路长度=最短路长度+1
这输出次短路条数+最短路条数,否则输出最短路条数
分析:这是到模版题,献上模版:
#include
#include
#include
#include
#include
#include
using namespace st...
分类:
其他 时间:
2015-05-25 22:31:17
收藏:
0 评论:
0 赞:
0 阅读:
264