ACM-ICPC北京赛区(2017)网络赛_Minimum】的更多相关文章

题目9 : Minimum 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 You are given a list of integers a0, a1, -, a2^k-1. You need to support two types of queries: 1. Output Minx,y∈[l,r] {ax∙ay}. 2. Let ax=y. 输入 The first line is an integer T, indicating the number of…
#1578 : Visiting Peking University 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Ming is going to travel for n days and the date of these days can be represented by n integers: 0, 1, 2, …, n-1. He plans to spend m consecutive days(2 ≤ m ≤ n)in Beijing. Durin…
题目1 : Visiting Peking University 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Ming is going to travel for n days and the date of these days can be represented by n integers: 0, 1, 2, …, n-1. He plans to spend m consecutive days(2 ≤ m ≤ n)in Beijing. During…
#1582 : Territorial Dispute 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 In 2333, the C++ Empire and the Java Republic become the most powerful country in the world. They compete with each other in the colonizing the Mars. There are n colonies on the Mars,…
#1584 : Bounce 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 For Argo, it is very interesting watching a circle bouncing in a rectangle. As shown in the figure below, the rectangle is divided into N×M grids, and the circle fits exactly one grid. The bouncing…
#1586 : Minimum 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 You are given a list of integers a0, a1, …, a2^k-1. You need to support two types of queries: 1. Output Minx,y∈[l,r] {ax∙ay}. 2. Let ax=y. 输入 The first line is an integer T, indicating the number…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 You are given a list of integers a0, a1, …, a2^k-1. You need to support two types of queries: 1. Output Minx,y∈[l,r] {ax∙ay}. 2. Let ax=y. 输入 The first line is an integer T, indicating the number of test cases. (…
描述 You are given a list of integers a0, a1, …, a2^k-1. You need to support two types of queries: 1. Output Minx,y∈[l,r] {ax∙ay}. 2. Let ax=y. 输入 The first line is an integer T, indicating the number of test cases. (1≤T≤10). For each test case: The fi…
题意:平面上n个点,问你是否存在一种黑白染色方案,使得对于该方案,无法使用一条直线使得黑色点划分在直线一侧,白色点划分在另一侧.如果存在,输出一种方案. 如果n<=2,显然不存在. 如果所有点共线,且n>2,只需交替染色即可. 设凸包上的点数为K,如果K==n,且n==3,不存在,如果n>3,只需交替染色即可. 如果K<n,只需凸包上点涂黑,内部点留白即可. #include<cstdio> #include<algorithm> #include<c…
题意:给你一个序列(长度不超过2^17),支持两种操作:单点修改:询问区间中最小的ai*aj是多少(i可以等于j). 只需要线段树维护区间最小值和最大值,如果最小值大于等于0,那答案就是minv*minv: 如果最大值小于等于零,那么答案就是maxv*maxv: 要是最小值小于零,最大值大于零,答案就是minv*maxv. #include<cstdio> #include<cstring> #include<algorithm> using namespace std…
题意:给你一个串,仅含有a~g,且每个字母只出现最多一次.和一个光标初始位置,以及一个目标串,问你最少要多少的代价变化成目标串. 有五种操作:在光标前添加一个未出现过的字母,代价1. 删除光标前或者光标后的字母,代价1. 光标左移或者右移,代价0.5. 哈希,把串弄成一个八进制数,加上一个光标位置,状态数不超过8^8. 直接跑dijkstra即可. 要注意初始化的时候,可以单独记一个数组,表示用过的状态,仅仅重置这些状态,防止初始化复杂度过高. #include<cstdio> #includ…
#1579 : Reverse Suffix Array 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There is a strong data structure called "Suffix Array" which can effectively solve string problems. Let S=s1s2...sn be a string and let S[i,j] denote the substring of S ranging f…
编号 名称 通过率 通过人数 提交人数 A√水题(队友写的 Visiting Peking University 91% 1122 1228 B— Reverse Suffix Array 57% 68 119 C最大子矩阵和 Matrix 51% 182 353 D缩点/二分/数位dp Agent Communication 11% 23 209 E凸包 Territorial Dispute 57% 327 567 F— Cake 15% 15 95 G√找规律 Bounce 74% 456…
#1586 : Minimum Time Limit:1000ms Case Time Limit:1000ms Memory Limit:256MB Description You are given a list of integers a0, a1, …, a2^k-1. You need to support two types of queries: 1. Output Minx,y∈[l,r] {ax∙ay}. 2. Let ax=y. Input The first line is…
题意: 给定一副n*m的格子图, 问从左上角的点开始往右下角滑,碰到墙壁就反弹, 碰到角落就停止, 问恰好经过一次的格子有多少个. 如图,恰好经过一次的格子有39个. 分析: 首先要引入两个概念, “路径长”,“格子数”. 路径长指的是整段路程的长度,如果走过同一个格子两次那么就算是2步. 格子数指的是整段路程经过的格子. 如果一个图是9*9(形如n*n)的, 那么就是从左上角一直到右下角, 走过的“路径长”恰好等于“格子数”,没有任何的格子被走过两次. 但对于一幅9 * 15这样不规则的图,“…
https://hihocoder.com/problemset/problem/1586 线段树操作,原来题并不难..... 当时忽略了一个重要问题,就是ax*ay要最小时,x.y可以相等,那就简单了!结果显然是模最小的数的平方或者是个负数. 要求乘积最小只要求区间内最大值.最小值和绝对值小的数,再判断min,max正负就行了. 下面的代码相当于建了三个树分别存Min,Max,Mid(abs(Min)) #include<iostream> #include<cstdio> #i…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 The Yongzheng Emperor (13 December 1678 – 8 October 1735), was the fifth emperor of the Qing dynasty of China. He was a very hard-working ruler. He cracked down on corruption and his reign was known for being des…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats very much. Last…
E: Cats and Fish 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cat…
#1228 : Mission Impossible 6 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 You must have seen the very famous movie series,"Mission Impossible", from 1 to 4. And "Mission Impossible 5" is now on screen in China. Tom Cruise is just learning pro…
描述 Institute of Computational Linguistics (ICL), Peking University is an interdisciplinary institute of science and liberal arts, it focuses primarily on the fundamental researches and applications of language information processing. The research of…
描述 The history of Peking University Library is as long as the history of Peking University. It was build in 1898. At the end of year 2015, it had about 11,000 thousand volumes of books, among which 8,000 thousand volumes were paper books and the othe…
#1389 : Sewage Treatment 时间限制:2000ms 单点时限:2000ms 内存限制:256MB 描述 After years of suffering, people could not tolerate the pollution in the city any more, and started a long-lasting protest. Eventually, the municipal government made up its mind to deal w…
#1391 : Countries 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are two antagonistic countries, country A and country B. They are in a war, and keep launching missiles towards each other. It is known that country A will launch N missiles. The i-th miss…
#1392 : War Chess 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 Rainbow loves to play kinds of War Chess games. There are many famous War Chess games such as "Biography of Cao Cao", "Anecdotes of Wagang Mountain", etc. In this problem, let's c…
#1236 : Scores 时间限制:4000ms 单点时限:4000ms 内存限制:256MB 描述 Kyle is a student of Programming Monkey Elementary School. Just as others, he is deeply concerned with his grades. Last month, the school held an examination including five subjects, without any do…
#1235 : New Teaching Buildings 时间限制:2000ms 单点时限:2000ms 内存限制:256MB 描述 Thanks to the generous finance income, Programming Monkey Elementary School is going to build three new teaching buildings. The school could be seen as a connected graph with n vert…
题目链接:哈哈哈哈哈哈 _(:з」∠)_ _(:з」∠)_ _(:з」∠)_ _(:з」∠)_ _(:з」∠)_ 哈哈哈哈哈哈,从9月16日打了这个题之后就一直在补这道题,今天终于a了,哈哈哈哈哈哈. 先把代码贴上,有时间再好好写题解,哈哈哈哈哈哈. ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ヾ(◍°∇°◍)ノ゙ 代码,嘻嘻: #include<bits/stdc++.h> using namespace std; typedef long long ll…
地址:https://nanti.jisuanke.com/t/17314 题目: Three circles C_{a}C​a​​, C_{b}C​b​​, and C_{c}C​c​​, all with radius RR and tangent to each other, are located in two-dimensional space as shown in Figure 11. A smaller circle C_{1}C​1​​ with radius R_{1}R​1…
xor There is a tree with nn nodes. For each node, there is an integer value a_ia​i​​, (1 \le a_i \le 1,000,000,0001≤a​i​​≤1,000,000,000 for 1 \le i \le n1≤i≤n). There is qq queries which are described as follow: Assume the value on the path from node…