![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
带你飞系列
zjy2015302395
ACM要AC
展开
-
[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 visit her, but since the water is dirty and full of t原创 2016-11-29 23:18:31 · 348 阅读 · 0 评论 -
CF--Technocup 2017 - Elimination Round 2(ABCDE)
真的不是模拟专场么?(大雾A题:题意:遇到ogo换成*** 后面紧接着的所有go忽略,其他字符打印出来tip:while大法好#include <cstdio>#include <iostream>#include <cstring>using namespace std;const int maxn = 110;int n;char s[maxn];void init(){原创 2016-11-22 21:29:23 · 541 阅读 · 0 评论 -
[kuangbin带你飞]专题一 简单搜索 M
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>0,N>原创 2016-11-24 15:28:03 · 377 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习-E
http://poj.org/problem?id=1860 DescriptionSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operat原创 2016-12-13 21:05:44 · 430 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习H,I,J
H题: http://poj.org/problem?id=3660题意:给你n个点,m个关系,每个关系说明了u在v前 问能确定下来位置的点有多少tip:首先能想到一个点的前面+后面= n-1就是确定位置,那怎么知道呢? dfs啊。。。。但是这个貌似是最短路专题QAQ,那就Floyd,floyd本身的想法就是用一个中间点更新两边点的关系,这个题也是一样,前驱的前驱一定是前驱,找到所有这样的就好原创 2016-12-15 22:07:31 · 418 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习 -F
http://poj.org/problem?id=3259题意:有的边是负数,问从一点出发能不能用小于0的时间回去tip:路是双向,虫洞单向,其他模板。。。要气死了。。。。双向着了1h错误#include <cstdio>#include <iostream>#include <cstring>#include <queue>using namespace std;queue<int>q原创 2016-12-14 11:29:28 · 277 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习 MN
http://poj.org/problem?id=1062题意:中问题。。。tip:加上一个源点0,然后求0到1的最短路,不过这题唯一的限制是有一个等级限定,对于等级限定的话就直接用枚举等级区间来完成了。还有题目中说的“优惠价格”是优惠之后的价格。。。#include <cstdio>#include <iostream>#include <queue>#include <cstring>原创 2016-12-21 14:08:12 · 335 阅读 · 0 评论 -
Codeforces Round #384 (Div. 2)(ABCDE)
A:题意:第I个和第j个相同为0,不同为1tip:只可能是0或者1#include <cstdio>#include <iostream>#include <cstring>using namespace std;int c[100010];int main(){ int n,a,b; scanf("%d%d%d ",&n,&a,&b); for(int i = 1原创 2016-12-15 09:06:43 · 344 阅读 · 0 评论 -
cf#383 div2(ABCDE)
A题:题意:1378的n次方最后一位tip:8 4 2 6循环,hack点:0次方是1 (栗子同学直接快速幂。。。巧妙避开)#include <cstdio>#include <iostream>#include <cstring>using namespace std;int main(){ int ans,n; scanf("%d",&n); if(n == 0)原创 2016-12-08 18:12:17 · 305 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习 P
http://acm.hdu.edu.cn/showproblem.php?pid=4725题意:有n个点 , m条无向边 , 每条边都是有权值 , 并且 , 每个点属于一个楼层 , 相邻楼层之间任意两点可以通过 , 但是要花费 c , 求 1 到 n的最小花费(同楼层没有边的两个点还是不能通过)tip:直接相互两边肯定会tle,然后我想每个楼层一个点,同楼层每个点入他出他都是0的边,两个楼层间新加原创 2016-12-29 09:51:09 · 362 阅读 · 1 评论 -
[kuangbin带你飞]专题六 最小生成树A
http://poj.org/problem?id=1251题意:题目大意在相通n个岛屿的所有桥都坏了,要重修,重修每一个桥所用的时间不同,求重修使每个岛屿都间接或直接与其他岛屿相同时所用的的最短时间(只有修完一个桥后才可修下一个桥)。 对于数据,数据输入的第一行n代表岛屿的个数,当为0是结束程序,接着n-1行开始时为这岛屿的编号,用大写字母表示,接着是一个整数m,表示与该岛屿连接的字典序大于该岛原创 2017-01-05 21:19:03 · 369 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习 K(差分约束)L
http://poj.org/problem?id=3159题意:给m个信息,abc 表示a不能比b多超过c个,问1比n最多能多 多少tip:就是最短路。。。卡queue不卡stack======#include <cstdio>#include <iostream>#include <cstring>#include <queue>using namespace std;int n,m;原创 2016-12-20 23:03:36 · 358 阅读 · 0 评论 -
[kuangbin带你飞]专题六 最小生成树 C
http://poj.org/problem?id=2031题意:给定一些个球的圆心与半径,如果两个球之间相交,则他们之间连通,否则不连通,问还需要连多长的边使所有球都连通tip:一个已存在边的最小生成树,只不过题目太难读了,任意两个球,如果连通则边权为0,否则边权为d-r1-r2,d是两球圆心坐标之间的距离,r1与r2分别为两个球的半径,这样求一个最小生成树,将所有球连接起来#include <c原创 2017-01-16 17:54:49 · 271 阅读 · 0 评论 -
[kuangbin带你飞]专题六 最小生成树 D
题意:给每两个点之间的距离,然后给几个点已经相连,问最小生成树。。tip:显然用kru之间把已知放在一个集里面很简单。#include <cstdio>#include <iostream>#include <cstring>#include <algorithm>const int maxm = 10010;const int maxn = 110;using namespace st原创 2017-01-17 15:30:26 · 234 阅读 · 0 评论 -
vijos循环(高精度)
乐乐是一个聪明而又勤奋好学的孩子。他总喜欢探求事物的规律。一天,他突然对数的正整数次幂产生了兴趣。 众所周知,2的正整数次幂最后一位数总是不断的在重复2,4,8,6,2,4,8,6……我们说2的正整数次幂最后一位的循环长度是4(实际上4的倍数都可以说是循环长度,但我们只考虑最小的循环长度)。类似的,其余的数字的正整数次幂最后一位数也有类似的循环现象。 这时乐乐的问题就出来了:是不是只有最后一位才原创 2017-01-18 19:37:05 · 535 阅读 · 0 评论 -
[kuangbin带你飞]专题一 简单搜索L
A题,B题,C题这三道题实在是没什么说的QAQ, A:#include <cstdio>#include <iostream>#include <cstring>#define maxn 10using namespace std;int m,n,ans;char s[maxn][maxn];bool cal[maxn];void init(){ ans= 0 ;原创 2016-11-22 12:59:16 · 719 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习D
Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional原创 2016-12-03 10:50:11 · 266 阅读 · 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 Frog who is sitting on another stone. He plans to vis原创 2016-11-30 11:46:02 · 347 阅读 · 0 评论 -
[kuangbin带你飞]专题一 简单搜索 A
Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8原创 2016-11-18 16:09:09 · 344 阅读 · 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 filled with rock. It takes one minute to move one unit原创 2016-11-18 16:13:50 · 370 阅读 · 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,000) on a number line and the cow is at a point K (0原创 2016-11-18 16:36:01 · 311 阅读 · 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 cows in which they manipulate an M × N grid (1 ≤ M ≤ 15原创 2016-11-18 16:55:17 · 678 阅读 · 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 0 and 1. You may assume that n is not greater than 2原创 2016-11-18 17:13:59 · 570 阅读 · 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 room numbers on their offices. — It is a matter of se原创 2016-11-18 17:33:04 · 379 阅读 · 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 stacks of poker chips, S1 and S2, each stack containing原创 2016-11-18 17:43:54 · 540 阅读 · 0 评论 -
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: 1 FILL(i) fill the pot i (1 ≤ i ≤ 2) from th原创 2016-11-18 17:49:00 · 357 阅读 · 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 this board is consisting of grass or just empty and the原创 2016-11-19 10:34:16 · 570 阅读 · 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, portions of the maze have caught on fire, and the owner of the m原创 2016-11-19 18:49:15 · 772 阅读 · 0 评论 -
[kuangbin带你飞]专题一 简单搜索 K
http://poj.org/problem?id=3984少了一篇题解强迫症会不开心。。。 10min写完1A的题说什么?#include <cstdio>#include <iostream>#include <cstring>#include <queue>using namespace std;const int maxn = 10;typedef pair<int,int>p原创 2016-11-20 01:27:51 · 540 阅读 · 1 评论 -
[kuangbin带你飞]专题四 最短路练习-G
题意:题意:信息传输,总共有n个传输机,先要从1号传输机向其余n-1个传输机传输数据,传输需要时间,给出一个严格的下三角(其实就是对角线之下的不包括对角线的部分)时间矩阵,a[i][j]代表从i向j传输数据需要的时间,并规定数据传输之间并无影响,即第一个传输机可以同时向其余传输机传输数据。求所有传输任务所需的最短时间。tip:我知道这道题查体题姐估计都是看不懂题orz http://poj.org原创 2016-12-14 19:27:31 · 244 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习 C
http://poj.org/problem?id=1797 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether原创 2016-12-03 01:05:45 · 334 阅读 · 0 评论 -
[kuangbin带你飞]专题四 最短路练习 R
http://acm.hdu.edu.cn/showproblem.php?pid=4370 这是整套里面我觉得最有意思的一道最短路,也确实让我觉得我与真正acmer之间的距离还是很大的题意:给你一个n*n的矩阵,然后让咱们构造另一个n*n的矩阵,构造的矩阵有如下要求, 1.X12+X13+…X1n=1. 2.X1n+X2n+…Xn-1n=1. 3.for each i (1tip:额。。这原创 2016-12-29 15:18:49 · 411 阅读 · 1 评论