Contest 1445】的更多相关文章

A \(a\) 中第 \(i\) 小的配 \(b\) 中第 \(i\) 大的. 限制相同,这样配最平均. 时间复杂度 \(O\left(tn\log n\right)\). B 最终的一百名至少是第一场的一百名或是第二场的一百名. 而两人的得分分别是 \(a+b\) 和 \(c+d\),取 \(\min\) 即可. 时间复杂度 \(O\left(t\right)\). C 满足条件的 \(x\) 肯定存在某个质因数的个数小于该因数在 \(q\) 中的个数. 先判断 \(p\) 是否被 \(q\)…
比赛链接:https://codeforces.com/contest/1445 A. Array Rearrangment 题意 给定两个大小均为 \(n\) 的升序数组 \(a\) 和 \(b\) ,判断能否重排数组 \(b\) 使得对任意 \(i\) 均满足 \(a_i + b_i \le x\) . 题解一 因为 \(a\) 为升序,所以将 \(b\) 按照降序排列判断即可. 代码 #include <bits/stdc++.h> using namespace std; int ma…
    Programming Contest Problem Types Hal Burch conducted an analysis over spring break of 1999 and made an amazing discovery: there are only 16 types of programming contest problems! Furthermore, the top several comprise almost 80% of the problems s…
Area of Mushroom Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2390    Accepted Submission(s): 578 Problem Description Teacher Mai has a kingdom with the infinite area. He has n students guard…
Differencia Time Limit: 10000/10000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 601    Accepted Submission(s): 173 Problem Description Professor Zhang has two sequences a1,a2,...,an and b1,b2,...,bn. He wants to…
Rigid Frameworks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 337    Accepted Submission(s): 273 Problem Description Erik Demaine is a Professor in Computer Science at the Massachusetts Insti…
题目链接: Coding Contest Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others) Problem Description A coding contest will be held in this university, in a huge playground. The whole playground would be divided into N blocks,…
#1445 : 后缀自动机二·重复旋律5 时间限制:10000ms 单点时限:2000ms 内存限制:256MB 描述 小Hi平时的一大兴趣爱好就是演奏钢琴.我们知道一个音乐旋律被表示为一段数构成的数列. 现在小Hi想知道一部作品中出现了多少不同的旋律? 解题方法提示 输入 共一行,包含一个由小写字母构成的字符串.字符串长度不超过 1000000. 输出 一行一个整数,表示答案. 样例输入 aab 样例输出 5 后缀自动机,学习了最短路的转移. /************************…
偏方记录背包里的物品.....每个背包的价值+0.01 Happy Programming Contest Time Limit: 2 Seconds      Memory Limit: 65536 KB In Zhejiang University Programming Contest, a team is called "couple team" if it consists of only two students loving each other. In the cont…
2012 Multi-University Training Contest 9 / hdu4389 打巨表,实为数位dp 还不太懂 先这样放着.. 对于打表,当然我们不能直接打,这里有技巧.我们可以这样:每隔100000我们统计一次,这样在10^9范围内,我们得到10000个数. 然后就很好解决了... 数位dp:http://blog.csdn.net/acdreamers/article/details/9318727 #include<iostream> #include<cst…
2014 Multi-University Training Contest 9#11 Killing MonstersTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 562    Accepted Submission(s): 308 Problem Description Kingdom Rush is a popular TD…
2014 Multi-University Training Contest 9#6 Fast Matrix CalculationTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 424    Accepted Submission(s): 219 Problem Description One day, Alice and Bob…
每次开一个坑都像是重新被碾压的预感 最近的新闻,以前很喜欢乔任梁的<复活>...然后他就死了...感觉我再多愁善感一点的话...就要悲伤逆流成河了吧... Contest 09/24(乐滋滋的场,良心场)100+100+0 T1:这题做得很羞愧...因为我根本证不出那个结论..猜的.. T2:这题做得很羞愧...因为听到了隔壁GG讲了伸头缩尾法... T3:因为少了一个半小时就没交.yy了一个跟正解差不多的想法...只是把枚举K去掉了,但是这样就MLE了...我口胡一下..不写了因为懒得评测.…
8/11 2016 Multi-University Training Contest 1 官方题解 老年选手历险记 最小生成树+线性期望 A Abandoned country(BH) 题意: 1. 求最小生成树 2. 求在某一棵最小生成树任意两点的最小距离的期望值. 思路: 首先题目说了边权值都是不同的,所以最小生成树唯一.那么只要统计出最小生成树的每一条边在“任意两点走经过它“的情况下所贡献的值,发现在一棵树里,一条边所贡献的次数为,sz[v]表示v子树包括节点v的个数.如下图所示,红边所…
8/13 2016 Multi-University Training Contest 2官方题解 数学 A Acperience(CYD)题意: 给定一个向量,求他减去一个  α(>=0)乘以一个值为任意+1或-1的B向量后得到向量,求这个向量膜的最小值思路: 展开式子,当时最小,结果为. 代码: #include <bits/stdc++.h> using namespace std; long long w,a,b,c,a2; long long gcd(long long x,l…
5/11 2016 Multi-University Training Contest 3官方题解 2016年多校训练第三场 老年选手历险记 暴力 A Sqrt Bo(CYD) 题意:问进行多少次开根号向下取整能使给定的值为1,若为5次以上,则输出TAT: 思路: 有5次这个限制,得知值最大为10的11次方左右,存下后运算即可,注意初始值为0时运算的次数是大于5次的,输出TAT: 代码: #include <bits/stdc++.h> using namespace std; char st…
6/12 2016 Multi-University Training Contest 4官方题解 KMP+DP A Another Meaning(CYD) 题意: 给一段字符,同时给定你一个单词,这个单词有双重意思,字符串中可能会有很多这种单词,求这句话的意思总数:hehe. 思路: 可以用kmp算法快速求出串中的单词数量,若单词是分开的,每个单词有两种意思,可以直接相乘,若两个及以上单词在原串中是有交集的,那么数量不是直接相乘,发现这片连在一起的单词数量dp[i]=dp[i-1]+dp[j…
6/12 2016 Multi-University Training Contest 5 期望+记忆化DP A ATM Mechine(BH) 题意: 去ATM取钱,已知存款在[0,K]范围内,每一次输入取出钱的金额,如果大于存款,ATM会发出警报,最多W次,问能在W次内取出所有存款的取款次数的期望值. 思路: 设dp[k][w]表示范围存款在[0,k]内,还有w次报警机会的期望值.状态转移方程: 代码: #include <bits/stdc++.h> const int N = 2e3…
5/12 2016 Multi-University Training Contest 6 官方题解 打表找规律/推公式 A A Boring Question(BH) 题意: ,意思就是在[0,n]里选择m个数字的相邻数字二项式组合的积的总和. 思路: 想了好久,不会,但是这题有300多人过,怀疑人生... 打了个表: n=0, m=2, ans=1n=1, m=2, ans=3n=2, m=2, ans=7n=3, m=2, ans=15n=4, m=2, ans=31n=5, m=2, a…
PowMod Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1008    Accepted Submission(s): 341 Problem Description Declare:k=∑mi=1φ(i∗n) mod 1000000007 n is a square-free number. φ is the Euler's…
Subway Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 860    Accepted Submission(s): 126Special Judge Problem Description jiefangxuanyan and yiyi cat are universally acknowledged model couple…
Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 588    Accepted Submission(s): 146 Problem Description   Sea5 and wzh are playing games. There are some guards on an n × m chessboard. Every…
A.Toda 2 思路:可以有二分来得到最后的数值,然后每次排序去掉最大的两个,或者3个(奇数时). /************************************************ *Author* : Ray(siludose) *Created Time* : 2016��10��24�� ����һ 15ʱ00��28�� **Problem** : /media/ray/708898B888987E72/Users/Administrator/Desktop/2016…
April Fools Day Contest 2014 A.C.H三道题目 =================================================================== A. The Great Game 这题怎没看懂..看了官方题解真是恍然大悟啊,原来是石头剪刀布啊!!! 8< 代表剪刀啊 () 代表石头啊 [] 代表布啊 真是逆天啊,这么一说还真觉得有点像....尤其是那个剪刀. 给那个出题人的想象力跪了. /* * ===============…
Happy Programming Contest  ZOJ3703 老实说:题目意思没看懂...(希望路过的大神指点) 最后那个the total penalty time是什么意思啊!!! 还是学到点东西的... 解题的关键在于:要控制最后所用的时间最少,所以在程序的最开始应该先将输入的各种题目 以时间升序排列, 然后就可以保证每次都以时间小的优先选, 这样就可以保证最后相同的吸引值和解题数的情况下所花的时间最少. #include <iostream> #include <stdi…
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28417#problem/F 题目大意:给n个点,求相聚最远距离的平方(输出整形) 集体思路:先求出包围所有点的凸包,然后暴力枚举求解(直接暴力会超时) #include<iostream> #include<cmath> #include<string.h> #include<string> #include<stdio.h> #inc…
/* poj 2187 Beauty Contest 凸包:寻找每两点之间距离的最大值 这个最大值一定是在凸包的边缘上的! 求凸包的算法: Andrew算法! */ #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct Point{ Point(){} Point(int x, int y){ this->…
2015-2016 ACM-ICPC, NEERC, Northern Subregional Contest D Problem D. Distribution in Metagonia Input file: distribution.in Output file: distribution.out Time limit: 2 seconds Memory limit: 256 megabytes There are one hundred noble families in the cou…
LeetCode Weekly Contest 8 415. Add Strings User Accepted: 765 User Tried: 822 Total Accepted: 789 Total Submissions: 1844 Difficulty: Easy Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. Note: The…
Shanghai Regional Online Contest 1004 In the ACM International Collegiate Programming Contest, each team consist of three students. And the teams are given 5 hours to solve between 8 and 12 programming problems. On Mars, there is programming contest,…