2017-09-25 19:58:04 writer:pprp 题意看上去很难很难,但是耐心看看还是能看懂的,给你n位数字 你可以交换第一位和之后的某一位,问你采用最少的步数可以交换成目标 有五组数据 用BFS进行搜索,并进行剪枝,已经搜索过的点不再搜索 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #…
2017-09-24 20:11:21 writer:pprp 找到的大神的代码,直接过了 采用了扫描线+线段树的算法,先码了,作为模板也不错啊 题目链接:https://nanti.jisuanke.com/t/17313 题意:给你很多个矩形,让你得到矩形的面积,重叠部分只算一次 代码如下: //ac F #include <stdio.h> #include <string.h> #include <stdlib.h> #include <iostream&…
In this problem, we will define a graph called star graph, and the question is to find the minimum distance between two given nodes in the star graph. Given an integer nn, an n-dimensionaln−dimensionalstar graph, also referred to as S_{n}S​n​​, is an…
In this problem, we will define a graph called star graph, and the question is to find the minimum distance between two given nodes in the star graph. Given an integer nnn, an n−dimensionaln-dimensionaln−dimensional star graph, also referred to as Sn…
题意 : 乱七八糟说了一大堆,实际上就是问你从一个序列到另个序列最少经过多少步的变化,每一次变化只能取序列的任意一个元素去和首元素互换 分析 : 由于只能和第一个元素去互换这种操作,所以没啥最优的特别方法,只要乖乖模拟即可,如果第一个元素不在正确位置则将它和正确位置的元素交换使其回到正确位置,如果第一个元素的位置就是正确的,那么就往后找不在正确位置的元素将它互换到第一个去,然后再对第一个元素进行判断即可,直到序列变成最终满足条件的序列........ #include<bits/stdc++.h…
transaction transaction transaction Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 1496    Accepted Submission(s): 723 Problem Description Kelukin is a businessman. Every day, he travels arou…
transaction transaction transaction Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 1496    Accepted Submission(s): 723 Problem Description Kelukin is a businessman. Every day, he travels arou…
Apple Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 982    Accepted Submission(s): 323 Problem Description Apple is Taotao's favourite fruit. In his backyard, there are three apple trees with…
2017 ACM ICPC Asia Regional - Daejeon Problem A Broadcast Stations 题目描述:给出一棵树,每一个点有一个辐射距离\(p_i\)(待确定),但\(p_i==0\)的点不能辐射自己,只能由别的点辐射覆盖.求\(p_i\)的和的最小值. Problem B Connect3 题目描述:有一个\(4 \times 4\)的网格,两个人玩游戏,第一个人用黑棋,第二人用白棋.每次选择一列,将棋子扔下去,直到最下一个空的格子.现在给出第一个人下…
2017 ACM - ICPC Asia Ho Chi Minh City Regional Contest A - Arranging Wine 题目描述:有\(R\)个红箱和\(W\)个白箱,将这些箱子分成若干堆,使得每一堆只有一种颜色,然后将这些堆排成一排,使得相邻的堆的颜色不一样,并且每堆红箱的个数不能超过\(d\),问有多少种方案. solution 不会. B - Barcode 题目描述:有一排\(n\)个球,现在要给这\(n\)个球涂成红色或蓝色,使得红色球的个数等于蓝色球的个数…