LCA

http://codeforces.com/contest/519/problem/E题意:给你一个无根树,q个询问,每次输入两个节点,问到两个节点距离相同的点有几个tip:设1为根,dfs记录每个点子树的节点数量,每个点的高度, 倍增,找到u,v的lca,根据三个点的高度可以知道在从u到v的链...

2016-11-30 13:56:52

阅读数:185

评论数:0

[kuangbin带你飞]专题四 最短路练习 B

真的不知道要败给读题到什么时候。。。http://poj.org/problem?id=2253 Description Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona F...

2016-11-30 11:46:02

阅读数:153

评论数:0

[kuangbin带你飞]专题四 最短路练习 A

Description Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to v...

2016-11-29 23:18:31

阅读数:159

评论数:0

[kuangbin带你飞]专题一 简单搜索 M

大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)...

2016-11-24 15:28:03

阅读数:205

评论数:0

CF--Technocup 2017 - Elimination Round 2(ABCDE)

真的不是模拟专场么?(大雾A题:题意:遇到ogo换成*** 后面紧接着的所有go忽略,其他字符打印出来 tip:while大法好#include <cstdio> #include <iostream> #include <cstring> using name...

2016-11-22 21:29:23

阅读数:379

评论数:0

[kuangbin带你飞]专题一 简单搜索L

A题,B题,C题这三道题实在是没什么说的QAQ, A:#include <cstdio> #include <iostream> #include <cstring> #define maxn 10 using namespace std; int m,n,...

2016-11-22 12:59:16

阅读数:548

评论数:0

[kuangbin带你飞]专题一 简单搜索 K

http://poj.org/problem?id=3984少了一篇题解强迫症会不开心。。。 10min写完1A的题说什么?#include <cstdio> #include <iostream> #include <cstring> #include &l...

2016-11-20 01:27:51

阅读数:386

评论数:1

[kuangbin带你飞]专题一 简单搜索 J

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2671 Joe works in a maze. Unfortunately,...

2016-11-19 18:49:15

阅读数:580

评论数:0

[kuangbin带你飞]专题一 简单搜索 I

Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of thi...

2016-11-19 10:34:16

阅读数:345

评论数:1

kuangbin带你飞]专题一 简单搜索 H

http://poj.org/problem?id=3414 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: ...

2016-11-18 17:49:00

阅读数:203

评论数:0

[kuangbin带你飞]专题一 简单搜索 G

Description A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two sta...

2016-11-18 17:43:54

阅读数:180

评论数:0

[kuangbin带你飞]专题一 简单搜索 F

The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit roo...

2016-11-18 17:33:04

阅读数:188

评论数:0

[kuangbin带你飞]专题一 简单搜索 E

Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits ...

2016-11-18 17:13:59

阅读数:281

评论数:0

[kuangbin带你飞]专题一 简单搜索 D

Description Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cow...

2016-11-18 16:55:17

阅读数:237

评论数:0

[kuangbin带你飞]专题一 简单搜索C

Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,...

2016-11-18 16:36:01

阅读数:164

评论数:0

[kuangbin带你飞]专题一 简单搜索B

Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be fil...

2016-11-18 16:13:50

阅读数:165

评论数:0

[kuangbin带你飞]专题一 简单搜索 A

Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正...

2016-11-18 16:09:09

阅读数:193

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭