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\),从左到右找出上升的子序列,删除,继续找,直至所有的数被删…
题目链接: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 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…
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…
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…
// 深夜补水题,清早(雾)写水文 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]\)时刻要进门的人都能在这段期间进门.…
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…
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…
I. Sale in GameStore(贪心) time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output A well-known Berland online games store has announced a great sale! Buy any game today, and you can download more g…
Description Dasha decided to bake a big and tasty layer cake. In order to do that she went shopping and bought n rectangular cake layers. The length and the width of the i-th cake layer were ai and bi respectively, while the height of each cake layer…
A. Toda 2 题意:给你n个人,每个人的分数是a[i],每次可以从两个人到五个人的使得分数减一,使得最终的分数相等: 思路:假设答案为m:每个人的分数与答案m的差值为d[i],sum为d[i]的总和,max为d[i]的最大值:仅当sum-max>=max的时候才满足: 满足之后,总和为奇数,先取三个,再取两个(都是最大与次大值):偶数每次取两个即可: B. Minimum and Maximum 题意:人机交互题:给你一个数组 ,找出其中的最小值与最大值,需要在询问f(n)的次数内得到最大…