UOJ Contest #50: Goodbye Jihai】的更多相关文章

比赛传送门:Goodbye Jihai. \(\Huge{\mathbf{再见,己亥.\\你好,庚子!\\祝大家新春快乐!}}\) A. 新年的促销 这题如果直接做的话可能方向会想歪,方向对了其实就是入门题. 考虑这个性质:假设花钱购买了 \(i\) 袋大米,最后获得了 \(k\) 袋大米,则必然是花钱买了其中最便宜的 \(i\) 袋. 所以按照 \(p_i\) 从小到大排序,必然存在一个分界点,左侧获得的大米必然是花钱购买的,右侧获得的大米必然是赠送的. 做背包即可,要记一下购买了多少袋,后面…
contest 1 ~ contest 10: contest 11 ~ contest 20: contest 21 ~ contest 30 : https://www.cnblogs.com/zhangwanying/p/6753040.html contest 31 ~ contest 40: contest 41 ~ contest 50:https://www.cnblogs.com/zhangwanying/p/10065867.html contest 51 ~ contest…
[UOJ#50][UR #3]链式反应(分治FFT,动态规划) 题面 UOJ 题解 首先把题目意思捋一捋,大概就是有\(n\)个节点的一棵树,父亲的编号大于儿子. 满足一个点的儿子有\(2+c\)个,其中\(c\in A\),且\(c\)个儿子是叶子,另外\(2\)个存在子树,且两种点的链接的边是不同的,求方案数. 那么就考虑一个暴力\(dp\),设\(f[i]\)表示有\(i\)个节点的树的个数. 那么枚举它两个有子树的子树大小,然后把编号给取出来,得到: \[f[i]=\frac{1}{2}…
这次比赛真是太伤我心了. 比(惨)赛(不)结(忍)果(睹) 完挂感言 uoj round 5已经挂了一次了,没想到还要再挂第二次. 这次比赛的期望得分是\(100+100+100+70+10\)的.没想到第2.3题都挂了.QAQ 分析原因是自己过于自信,以为过了样例就AC.这只是美好的幻想罢了.以后比赛一定一定一定要对拍! 算法 A 新年的巧克力棒 画画样例就知道了.不过我居然用了20min,orz神犇5min. B 新年的毒瘤 一开始想错了,以为整个图是一棵树加一个环. 事实上,如果一个点不是…
2.14 晚上的比赛, 现在改好了四题, 还差提答. 在这补个题解 新年的xor Description 给你 \(n\) , 然后要你构造 \([L, R], L<R\) 使得区间异或和为 \(n\) Solution 做法多的是 我的方法是特判 \(n\le 4\) 的, 然后对于奇数用 \([n-3,n-1]\) , 偶数用 \([n-4, n]\) 新年的叶子 Description 一棵 \(n\le 5e5\) 的树, 每次会随机将一个原树的叶子染黑, 问白点最远距离什么时候变小 S…
在叶子童鞋的推荐下打了这场比赛... 感觉被虐爆了... 怎么这么多构造题... 我还没写过呢... 交互题是毛线...看了好久没看懂...就放弃了...(我语文好差QAQ...) 最后只会T1...T2没时间了,就随便水了一发...居然拿了30分(rp--)... 下面有一些是自己/小伙伴YY的想法...有一些是题解...先放官方题解... 就不放题面了...复制过来效果很神奇... A. 长度测量鸡 分析: 这个你脑补一下,划分成的长度一定是1~n的某个全排列,然后算一算,发现能够组合出来的…
2017.5.31 今天开了这个博客,打算每天来写点东西,嗯...毕竟要NOI了嘛... 第一天跑到常州里集训,打开题目一看湖南集训题... T1刷一下写完,然后交了然后发现错了...赶紧改过来,大概1h吧... T2刷一下发现了数学性质,刷一下发现要二分答案,刷一下建出了图,刷一下发现需要上下届可行流... 感觉要AC了呢-(一口毒奶) 然后...上下届可行流怎么做啊... 然后看着以前SJTU的板子理解了一下然后开始写... 然后就写完了啊-是不是能AC了呢... 赛后发现这题只有70,拿一…
UOJ Easy Round#7 传送门:http://uoj.ac/contest/35 题解:http://matthew99.blog.uoj.ac/blog/2085 #1 题意: 在一个(2n+1)*(2n+1)的网格中,每次只能走到相邻的点, 从左上端出发到右下端,找到一条路径,使此路径经过的所有点权值和最小. 输入:从内到外输出每一圈的点值大小:数据范围n<=10^5: 比赛中: 拿到题目,看到那极有特色性的一个大方格,以及极为特殊的走法,和那10^5的数据量,算法上基本可以确定贪…
题目链接: 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,…
http://uoj.ac/contest/35/problem/246 神奇!我这辈子是想不出这样的算法了. 对区间长度分类讨论:题解很好的~ 我已经弱到爆了,看完题解后还想了一晚上. 题解中"利用\(r_y\)进行计算更新答案"的具体方法是记录以当前点为右端点,任意两个数的差值的最小值大于等于j的区间的左端点,记为\(pos_j\). 就这个问题我想了一晚上啊TWT,我不滚粗谁滚粗QAQ #include<cmath> #include<cstdio> #i…
http://uoj.ac/contest/35/problem/244 对其他人来说好简单的一道题,我当时却不会做TWT 注定滚粗啊 题解很好的~ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; const int N = 100003; ll in() { ll k = 0, fh = 1; char c= getcha…
偏方记录背包里的物品.....每个背包的价值+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…
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了...我口胡一下..不写了因为懒得评测.…
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…
MightyHorse is playing a music game called osu!. After playing for several months, MightyHorse discovered the way of calculating score in osu!: 1. While playing osu!, player need to click some circles following the rhythm. Each time a player clicks,…
Description Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 <= N <= 50,000) farms around the world in order to spread goodwill bet…
zhx and contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 324    Accepted Submission(s): 118 Problem Description As one of the most powerful brushes in the world, zhx usually takes part i…
http://poj.org/problem?id=2187 显然直径在凸包上(黑书上有证明).(然后这题让我发现我之前好几次凸包的排序都错了QAQ只排序了x轴.....没有排序y轴.. 然后本题数据水,暴力也能过... (之前一直以为距离是单增的,其实并不是,应该是三角形面积单增...) 考虑旋转卡壳 一篇好的文章:http://www.cnblogs.com/Booble/archive/2011/04/03/2004865.html 首先对踵点就是两条平行线夹紧凸包的两个点(或者3个点或4…
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5499 The 12th Zhejiang Provincial Collegiate Programming Contest - G Lunch Time Time Limit: 2 Seconds      Memory Limit: 65536 KB The 999th Zhejiang Provincial Collegiate Programming C…
The Best Seat in ACM Contest Time Limit: 1000MS Memory limit: 65536K 题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous…
链接:http://poj.org/problem?id=2187 Description Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 <= N <= 50,000) farms around the wor…
Problem F Funny Car Racing There is a funny car racing in a city with n junctions and m directed roads. The funny part is: each road is open and closed periodically. Each road is associate with two integers (a, b), that means the road will be open fo…
Problem L Last Blood In many programming contests, special prizes are given to teams who solved a particular problem first. We call the first accepted solution "First Blood". It's an interesting idea to set prizes for "Last Blood". The…
JSU 2013 Summer Individual Ranking Contest - 5 密码:本套题选题权归JSU所有,需要密码请联系(http://blog.csdn.net/yew1eb). 一.套题分析:该套题难度不大,适合入门有一定基础的ACMer用于练习. 二.考点:逻辑思维.基础数论.数位运算基础.深度优先搜索.动态规划. 三.竞赛形式:个人赛 四.解题时间:3小时 五.题目情况: A. BNU ACM校队时间安排表        B. 硬币水题II        C. 沙漠之…
Rating Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 578    Accepted Submission(s): 363Special Judge Problem Description A little girl loves programming competition very much. Recently, she h…
MPI Maelstrom 题目链接: http://acm.hust.edu.cn/vjudge/contest/122685#problem/G Description BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsy…
算法零 $n,m \le 100, q \le 10$ 的话,直接给网格中的每一个格点都建一个点,然后该怎么最短路就怎么最短路,该怎么并查集+BFS就怎么并查集+BFS. 复杂度 $O(qnm)$,可以拿下前30分. 算法一 $n\le 10^5, m = 1, q\le 10^5$ 的话,我们可以直接预处理出 $(1,1)-(1,i)$ 的距离以及 $(1,i)-(1,n)$ 的距离,然后就枚举走的方式 $i-j$ 或者 $j-n-1-i$ 就可以啦. 复杂度 $O(n + q)$,结合算法零…
H - A + B Strikes Back A + B is often used as an example of the easiest problem possible to show some contest platform. However, some scientists have observed that sometimes this problem is not so easy to get accepted. Want to try? Input The input co…
题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous ACMers there. Cainiao attended Asia Regional Contest Fuzhou Site on N…