2017 ACM - ICPC Asia Ho Chi Minh City Regional Contest A - Arranging Wine 题目描述:有\(R\)个红箱和\(W\)个白箱,将这些箱子分成若干堆,使得每一堆只有一种颜色,然后将这些堆排成一排,使得相邻的堆的颜色不一样,并且每堆红箱的个数不能超过\(d\),问有多少种方案. solution 不会. B - Barcode 题目描述:有一排\(n\)个球,现在要给这\(n\)个球涂成红色或蓝色,使得红色球的个数等于蓝色球的个数…
目录 Contest Info Solutions Problem A. Accurate Movement Problem B. Bad Treap Problem E. Equidistant Problem H. High Load Database Problem I. Ideal Pyramid Problem J. Just the Last Digit Problem K. King's Children Problem M. Managing Difficulties Conte…
题目连接:https://codeforces.com/gym/102780 寒假第二次训练赛,(某菜依旧是4个小时后咕咕咕),战况还行,个人表现极差(高级演员) A:Green tea 暴力枚举即可 B:Mysterious Resistors 注意到电阻阻值具有单调性,二分 C:Emoticons 据说是模拟 D:Power play 由唯一分解定理可得,\(x=a^{\frac{p}{q}}\) ,由于\(x\leq10^{18}\)又\(x\)为整数,故\(p,q\)的范围极小,枚举即可…
A.Accurate Movement(复现赛) 题意:两个木块最左边都在0的位置,最右边分别为a,b(b>a),并且短的木条只能在长木条内移动,问两个木条需要移动多少次才能使两个木条的右端都在n 思路:短木条最少移动(n-a)/(b-a),如果(n-a)%(b-a)不为0,那么还需要再多移动一次,才能到达最右边,长木条以此类推 代码: 1 #include<iostream> 2 #include<algorithm> 3 #include<cmath> 4 #…
目录 Contest Info Solutions A. Berstagram B. The Feast and the Bus C. Trip to Saint Petersburg E. The Coronation F. Data Center G. Discarding Game H. Happy Birthday J. The Parade L. Divide The Students M. SmartGarden N. Wires Contest Info Practice Link…
A. Berstagram Polycarp recently signed up to a new social network Berstagram. He immediately published n posts there. He assigned numbers from 1 to n to all posts and published them one by one. So, just after publishing Polycarp's news feed contained…
题意:有个长度为\(n\)的监狱,犯人在位置\(a\),cop在位置\(b\),你每次可以向左或者向右移动一个单位,或者选择不动并在原地放一个爆竹\(i\),爆竹\(i\)在\(s[i]\)秒后爆炸,cop每次向你的位置移动一个单位,你最终一定会被抓住(因为监狱是有限的),问你在被抓住前,最多能看到多少爆竹爆炸. 题解:我们可以很容易算出最能放多少个爆竹不被cop抓住,和最晚被cop抓住的时间,然后对爆竹的爆炸时间排序,假如我们要放\(x\)个爆竹,那么很显然,最优的放法一定是在第一秒放\(s[…
题意:酒吧里有两个服务员,每个人每次都只能服务一名客人,服务员2按照客人进酒吧的顺序服务,服务员3按照客人的钱来服务,询问\(q\),\(1\)表示有客人进入酒吧,带着\(m\)块钱,\(2\)表示询问服务员2当前应该服务的客人编号,\(3\)表示服务员3当前应该服务的客人编号. 题解:搞两个set,第一个set存pair,存编号和钱,用重载运算符来模拟排序,第二个set只存编号,然后模拟乱搞就行. 代码: #include <bits/stdc++.h> #define ll long lo…
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…
ACM ICPC 2010–2011, Northeastern European Regional Contest St Petersburg – Barnaul – Tashkent – Tbilisi, November 24, 2010 Problem A. Alignment of CodeProblem B. Binary OperationProblem C. Cactus RevolutionProblem D. Dome of CircusProblem E. Evacuati…