题目链接:http://codeforces.com/gym/101158/attachments /* * @Author: lyucheng * @Date: 2017-10-21 12:20:04 * @Last Modified by: lyucheng * @Last Modified time: 2017-10-21 21:12:12 */ /* * 题意:给你两个字符串,让你求最长子串,子串在两个字符串中都出现(长度相同,出现的字母次数相同就行) * * 思路:枚举每个长度的字符串…
2017 ACM - ICPC Asia Ho Chi Minh City Regional Contest A - Arranging Wine 题目描述:有\(R\)个红箱和\(W\)个白箱,将这些箱子分成若干堆,使得每一堆只有一种颜色,然后将这些堆排成一排,使得相邻的堆的颜色不一样,并且每堆红箱的个数不能超过\(d\),问有多少种方案. solution 不会. B - Barcode 题目描述:有一排\(n\)个球,现在要给这\(n\)个球涂成红色或蓝色,使得红色球的个数等于蓝色球的个数…
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…
2017 ACM ICPC Asia Regional - Daejeon Problem A Broadcast Stations 题目描述:给出一棵树,每一个点有一个辐射距离\(p_i\)(待确定),但\(p_i==0\)的点不能辐射自己,只能由别的点辐射覆盖.求\(p_i\)的和的最小值. Problem B Connect3 题目描述:有一个\(4 \times 4\)的网格,两个人玩游戏,第一个人用黑棋,第二人用白棋.每次选择一列,将棋子扔下去,直到最下一个空的格子.现在给出第一个人下…
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-2018 ACM-ICPC, Asia Tsukuba Regional Contest A Secret of Chocolate Poles 思路:暴力枚举黑巧克力的个数和厚黑巧克力的个数 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define fi first #define s…
ACM ICPC Central Europe Regional Contest 2013 Jagiellonian University Kraków Problem A: Rubik’s RectangleProblem B: What does the fox say?Problem C: Magical GCDProblem D: SubwayProblem E: EscapeProblem F: DraughtsProblem G: History courseProblem H: C…
2019-2020 ICPC, Asia Jakarta Regional Contest (Online Mirror, ICPC Rules, Teams Preferred) easy: ACEGHK medium-easy: BJL medium: D ?????: I A. B. C. 对 \(R[],C[]\) 分别按奇偶性分段. 网! D. 考虑 check 一个串,枚举右走对应的前缀 pre,下走对应的后缀 suf. 把每行反串拼接中间连特殊字符,建 SA,能 match 上 p…
Brute Force Sorting Time Limit: 1 Sec  Memory Limit: 128 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=6215 Description Beerus needs to sort an array of N integers. Algorithms are not Beerus's strength. Destruction is what he excels. He can destr…
HDU 6197 array array array 题意 输入n和k,表示输入n个整数和可以擦除的次数k,如果至多擦除k次能是的数组中的序列是不上升或者是不下降序列,就是魔力数组,否则不是. 解题思路 分别求最长不下降和不上升子序列的长度,看不符合要求的数字和k的大小. 这里使用优化后的求解最长不上升和不下降子序列的算法. #include <cstdio> #include <algorithm> using namespace std; ; ; int A[maxn], B[…