题目链接:http://codeforces.com/group/aUVPeyEnI2/contest/229669 时间限制:1s 空间限制:64MB 题目大意:给定一个长度为2n,由n个大写字母和n小写字母组成的字符串,将对应的字母两两连接,且不相交,按顺序输出没个大写字母对应的小写字母的位置,如果不存在则输出"Impossible" 样例: 解法: 手动建立结构体,维护一个栈 代码: #include<bits/stdc++.h> using namespace st…
题目来源:http://codeforces.com/group/aUVPeyEnI2/contest/229669 时间限制:1s 空间限制:64MB 题目大意:给定n,a,b的值 求一个长度为n的由1和2组成的数列,要求数列中最多有a个连续的1和b个连续的2,问由多少种不同的数列 样例: 题目解法: 动态规划,使用一个二维数组,dp[i][1]代表当前位为1的前i个数的排列个数,dp[i][2]代表当前位为2的前i个数的排列个数 代码: #include <bits/stdc++.h> #…
Problem H. Password Service 题目连接: http://www.codeforces.com/gym/100253 Description Startups are here, startups are there. Startups are everywhere! Polycarp would like to have his own startup, too. His business idea is a password service. Have you not…
Problem H. Hometask 题目连接: http://codeforces.com/gym/100714 Description Kolya is still trying to pass a test on Numbers Theory. The lecturer is so desperate about Kolya's knowledge that she gives him the same task every time. The problem is to check i…
目录 2018-2019 ICPC, NEERC, Southern Subregional Contest (Codeforces 1070) A.Find a Number(BFS) C.Cloud Computing(线段树) D.Garbage Disposal(模拟) E.Getting Deals Done(二分) F.Debate(贪心) H.BerOS File Suggestion(后缀自动机) I.Privatization of Roads in Berland(网络流)…
2018-2019 ICPC, NEERC, Southern Subregional Contest 闲谈: 被操哥和男神带飞的一场ACM,第一把做了这么多题,荣幸成为7题队,虽然比赛的时候频频出锅,差点被鸽,但还算打完了5h 总的来说这场还是不算难的,7题还是少了点 A 题目: 给出a,b,求出一个数满足是a的倍数,且数字和为b 题解: 男神懒得写博客就甩锅了 直接宽搜,宽搜时队列中的状态保存为x,y,x表示当前的数%a==x,y表示数字和 然后记录状态和方案就行了 参考代码: #inclu…
$$2013-2014\ ACM-ICPC,\ NEERC,\ Eastern\ Subregional\ Contest$$ \(A.Podracing\) 首先枚举各个折现上的点,找出最小宽度,然后找每个存在摄像头的\(y\)值,在这个\(y\)坐标下找到最大间隔,和答案取\(max\)即可 //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/stdc++.h> using na…
从这里开始 题目列表 瞎扯 Problem A Find a Number Problem B Berkomnadzor Problem C Cloud Computing Problem D Garbage Disposal Problem E Getting Deals Done Problem F Debate Problem G Monsters and Potions Problem H BerOS File Suggestion Problem I Privatization of…
题目来源:http://codeforces.com/group/aUVPeyEnI2/contest/229510 时间限制:2s 空间限制:256MB 题目大意: 给定一个数字c 用 "max" "min" "+" "-" "" "/"对随机数 "?" 进行处理,使最后式子得到c的概率超过1/2 (所有数字均在0~255之间,"+" "…
第一次打ACM比赛,和yyf两个人一起搞事情 感觉被两个学长队暴打的好惨啊 然后我一直做傻子题,yyf一直在切神仙题 然后放一波题解(部分) A. Find a Number LINK 题目大意 给你d和s,求你一个最小的数满足是d的倍数且数字和是s 思路 从高位到低位考虑广搜,把当前的长度和模d的余数作为状态,然后添加一个数就在对应的位置上加 一个模数只记录长度最小的状态,然后可以反着贪心回去 yyf的神仙code: #include <iostream> #include <cstd…
秉承ACM团队合作的思想懒,这篇blog只有部分题解,剩余的请前往星感大神Star_Feel的blog食用(表示男神汉克斯更懒不屑于写我们分别代写了下...) C. Cloud Computing 扫描线搞一搞区间(主席树也OK啊,只是空间玄学,主席树理论空间nlogn实际上开小那么10倍8倍没什么锅啊zzzz),对于权值建立权值线段树,然后记录每个权值出现的次数以及区间权值和,然后在线段树上二分求答案即. #include<cstdio> #include<cstring> #i…
A. Find a Number 找到一个树,可以被d整除,且数字和为s 记忆化搜索 static class S{ int mod,s; String str; public S(int mod, int s, String str) { this.mod = mod; this.s = s; this.str = str; } } public static void main(String[] args) { IO io = new IO(); int[][]vis=new int[550…
i207M的“怕不是一个小时就要弃疗的flag”并没有生效,这次居然写到了最后,好评=.= 然而可能是退役前和i207M的最后一场比赛了TAT 不过打得真的好爽啊QAQ 最终结果: 看见那几个罚时没,全是我贡献的,还全是睿智的细节错误(逃 不罚时估计就进前100了啊QAQ,我好菜啊.jpg 我切了3道(然后挂了四次2333,i207M切了4道(orz),具体比赛历程太长了,不好写,就在题上写吧=.= A.Find a Number 开场不到十分钟就有神仙切了这神仙题 因为种种原因,这题到吃晚饭的…
A. Find a Number Solved By 2017212212083 题意:$找一个最小的n使得n % d == 0 并且 n 的每一位数字加起来之和为s$ 思路: 定义一个二元组$<d, s>$ 表示当前状态模d的值,以及每一位加起来的值 跑最短路,从$<0, 0>  跑到 <0, s>$ #include<bits/stdc++.h> using namespace std; ; const int INF = 0x3f3f3f3f; #de…
[链接] 我是链接,点我呀:) [题意] [题解] 我们可以很容易知道区间的每个位置有哪些安排可以用. 显然 我们优先用那些花费的钱比较少的租用cpu方案. 但一个方案可供租用的cpu有限. 我们可以用一个线段树 线段树的下标表示价格. 那一位的值,为这个价格的cpu能租多少个. 弄个区间和(即这个价格的区间总共能租多少个(最多) 再弄另外一个区间和sum表示价格区间内的所有cpu都租,要花多少钱. 因为每个位置最多要租k个cpu 利用上面的两个区间和则我们可以在线段树上做一个二分. 找到租前k…
A. 直接从状态(0,0)bfs, 这样一定是最小的 #include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #include <math.h> #include <set> #include <map> #include <queue> #include <string> #include <…
Problem I. Plugs and Sockets 题目连接: http://www.codeforces.com/gym/100253 Description The Berland Regional Contest will be held in the main hall of the Berland State University. The university has a real international status. That's why the power socke…
Problem F. Judging Time Prediction 题目连接: http://www.codeforces.com/gym/100253 Description It is not easy to predict. Do you know that the modern weather prediction is marginally better than to use the previous day weather as a prediction for the next…
Problem B. Travelling Camera Problem 题目连接: http://www.codeforces.com/gym/100253 Description Programming competitions become very popular in Berland. Now Berland Broadcasting Corporation (BBC) plans to organize a TV broadcast of the All-Berland Region…
Problem D. Distance 题目连接: http://codeforces.com/gym/100714 Description In a large city a cellular network operator is holding a competition for subscribers to promote their new "pedestrian navigator" service. The main prize will be awarded to th…
Problem C. Contest 题目连接: http://codeforces.com/gym/100714 Description The second round of the annual student collegiate programming contest is being held in city N. To be prepared for the inrush of participants, the jury needs to know the number of t…
题目来源:http://codeforces.com/group/aUVPeyEnI2/contest/229511 时间限制:1s 空间限制:512MB 题目大意: 给定一个n 随后跟着2n行输入 "+ t":表示在t时刻获得了一样东西 "- t":表示在t时刻使用了一样东西 求每件东西等待时间的期望(得到的东西无先后顺序) 数据范围: 1 ≤ n ≤ 100 000 t ≤ 1e9 样例: 题目解法: 使用递推式从后往前推 代码: #include <al…
题目来源:http://codeforces.com/group/aUVPeyEnI2/contest/229510 时间限制:1s 空间限制:512MB 题目大意: 给定一个字符串,使用%[...]形式将字符串中出现的字符整理到最短和最小(ASCII范围为32~126),可使用的字符有 '-' '^' 题目解法:模拟整理正的和使用 '^' 取反的两个字符串,输出较短较小的那个(注意当所有字符都存在时,输出%[^!]最小) 样例: 代码: #include <algorithm> #inclu…
题目来源:http://codeforces.com/group/aUVPeyEnI2/contest/229510 时间限制:2s 空间限制:256MB 题目大意: 给定一个凸多边形,有一种连接两个顶点可以将多边形分成两个非空的面积为整数的图形,询问这种线有多少条. 数据范围: 4 ≤ n ≤ 200 000 −109 ≤ xi, yi ≤ 109 样例: 代码: #include <algorithm> #include <iostream> #include <cstr…
Problem L. Stock Trading Robot 题目连接: http://www.codeforces.com/gym/100253 Description CyberTrader is an all-in-one trading solution for investment banks, quantitative hedge funds and proprietary trading groups. It has only one drawback it is not impl…
Problem D. Grumpy Cat 题目连接: http://www.codeforces.com/gym/100253 Description This problem is a little bit unusual. Here you are to implement an interaction with a testing system. That means that you can make queries and get responses in the online mo…
Problem C. Equivalent Cards 题目连接: http://www.codeforces.com/gym/100253 Description Jane is playing a game with her friends. They have a deck of round cards of radius 100. Each card has a set of disjoint rectangles strictly within the bounding circle.…
Problem K. KMC Attacks 题目连接: http://codeforces.com/gym/100714 Description Warrant VI is a remote planet located in the Koprulu Sector. Warrant VI features a strange huge field, which was discovered by the Kel-Morian Combine (KMC). The KMC is involved…
Problem J. Joke 题目连接: http://codeforces.com/gym/100714 Description The problem is to cut the largest possible number of circles with diameter y out of a stripe of length x and width y. Input The only line of input consists of two positive real number…
Problem I. Interest Targeting 题目连接: http://codeforces.com/gym/100714 Description A unique display advertisement system was developed at the department of advertising technologies, Yaagl Inc. The system displays advertisements that meet the interests…