L. Useful Roads time limit per test:4 seconds memory limit per test:512 megabytes input:standard input output:standard output Berland capital contains n junctions and m roads connecting pairs of junctions. All roads are one-way. As you probably know…
2018-2019 ICPC, NEERC, Southern Subregional Contest 闲谈: 被操哥和男神带飞的一场ACM,第一把做了这么多题,荣幸成为7题队,虽然比赛的时候频频出锅,差点被鸽,但还算打完了5h 总的来说这场还是不算难的,7题还是少了点 A 题目: 给出a,b,求出一个数满足是a的倍数,且数字和为b 题解: 男神懒得写博客就甩锅了 直接宽搜,宽搜时队列中的状态保存为x,y,x表示当前的数%a==x,y表示数字和 然后记录状态和方案就行了 参考代码: #inclu…
目录 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(网络流)…
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 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…
第一次打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.Toda 2 思路:可以有二分来得到最后的数值,然后每次排序去掉最大的两个,或者3个(奇数时). /************************************************ *Author* : Ray(siludose) *Created Time* : 2016��10��24�� ����һ 15ʱ00��28�� **Problem** : /media/ray/708898B888987E72/Users/Administrator/Desktop/2016…
2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest, qualification stage A. Union of Doubly Linked Lists 题目描述:给出很多个双向链表,将它们连成一个双向链表. solution 模拟,尾连头. 时间复杂度:\(O(n)\) B. Preparing for Merge Sort 题目描述:给出\(n\)个不同的数\(a_i\),从左到右找出上升的子序列,删除,继续找,直至所有的数被删…
// 深夜补水题,清早(雾)写水文 A. Automatic Door 题意 \(n(n\leq 1e9)\)个\(employee\)和\(m(m\leq 1e5)\)个\(client\)要进门,\(employee\)进门的时刻为\(a,2a,...,.na\),\(client\)进门的时间则由输入数据给定. 这个门很厉害,是个自动门.如果第\(k\)时刻有人要进门,那么它会在第\(k\)时刻打开,在第\(k+d\)时刻再关闭,在\([k,k+d]\)时刻要进门的人都能在这段期间进门.…
2014-2015 ACM-ICPC, NEERC, Southern Subregional Contest 2019年10月11日 15:30-20:30(Solved 6,Penalty 740) 国庆咸鱼十来天,回来又过了快一个星期,终于和队友约上了模拟赛.(周三拖周四,因为队(fei)友(zhai)们要跑1000米,又拖到周五QAQ) I:00:04.开场翻翻题目,机智如我很快找到一个贪心. D:00:36.看了看现场榜,有人交D.F和M,lh同学已经开F去了,xk同学说他M思路差不多…
2018-2019 ACM-ICPC, NEERC, Southern Subregional Contest, Qualification Stage A. Coffee Break 排序之后优先队列搞一下就好了 //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<bits/stdc++.h> using name…
$$2014-2015\ ACM-ICPC,\ NEERC,\ Southern\ Subregional\ Contest$$ A Nasta Rabbara B Colored Blankets 只要每组都能用两种以下的颜色合成即可,可以发现答案必然存在,考虑用数量最多的颜色和数量最少的颜色组合,递归处理 略证:颜色最少的数量\(\le \frac{k}{n}\),颜色最多的数量\(\ge \frac{k}{n}\),每次组合完成之后上述条件不变 //#pragma comment(link…
Email AliasesCrawling in process... Crawling failed Time Limit:2000MS     Memory Limit:524288KB     64bit IO Format:%I64d & %I64u Submit Status Description   Input   Output   Sample Input   Sample Output   Hint   Description Polycarp has quite recent…
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…
题目链接:http://codeforces.com/problemset/problem/847/I I. Noise Level time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output The Berland's capital has the form of a rectangle with sizes n × m quarte…
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 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 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 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 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…
http://codeforces.com/contest/847/problem/D 巧妙的贪心 仔细琢磨... 像凸包里的处理 #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <time.h> #include <string> #include <set> #include <map> #i…
题目链接: https://codeforces.com/gym/101911 又补了set的一个知识点,erase(it)之后it这个地址就不存在了,再引用的话就会RE A: ✅ B:  ✅ C:  ✅ D:  ✅ E: https://blog.csdn.net/Link_Ray/article/details/89404428 F:  ✅ G:  https://blog.csdn.net/Link_Ray/article/details/89403094 H: ✅ I: ✅ J: ✅ K…
A. Toda 2 time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output A group of n friends enjoys playing popular video game Toda 2. There is a rating system describing skill level of each player, ini…
A. Toda 2 按题意模拟即可. #include <bits/stdc++.h> using namespace std ; typedef pair < int , int > pii ; #define clr( a , x ) memset ( a , x , sizeof a ) const int MAXN = 105 ; pii a[MAXN] ; int G[MAXN * MAXN][MAXN] ; int n , x ; void solve () { int…