链接:https://ac.nowcoder.com/acm/problem/15164 题目描述 给一个数列,会有多次询问,对于每一次询问,会有两种操作: 1:给定两个整数x, y, 然后在原数组的第x位置上加y: 2:给定两个整数l,r,然后输出数组从第l位加到第r位数字的和并换行 输入描述: 第一行有两个整数n, m(1 <= n, m <= 100000)代表数列的长度和询问的次数第二行n个数字,对于第i个数字a[i],(0<=a[i]<=100000).接下来m行,每一行…
链接:https://ac.nowcoder.com/acm/contest/886/J来源:牛客网 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 Rowlet is playing a very popular game in the pokemon world. Recently, he has encountered a problem and wants to ask for…
[牛客网]Whalyzh's Problem 每个\(b_{i,j}\)建一个点,认为选了\(b_{i,j}\)一定会选\(a_{i}\)和\(a_{j}\) 选了\(a_{i}\)的话会带了一个\(-b_{i,i}\)的价值 然后再用01分数规划二分答案,选了\(a_{i}\)还会带来\(-x\)的代价,x是二分的答案 如果正数值减最大流大于0认为这个答案可以达到 #include <bits/stdc++.h> #define fi first #define se second #def…
链接:https://www.nowcoder.com/acm/contest/140/J 来源:牛客网 White Rabbit has a rectangular farmland of n*m. In each of the grid there is a kind of plant. The plant in the j-th column of the i-th row belongs the a[i][j]-th type. White Cloud wants to help Whi…
链接:https://ac.nowcoder.com/acm/contest/882/F来源:牛客网 Given 2N people, you need to assign each of them into either red team or white team such that each team consists of exactly N people and the total competitive value is maximized. Total competitive va…
链接:https://www.nowcoder.com/acm/contest/148/D来源:牛客网 Prefix Sum is a useful trick in data structure problems. For example, given an array A of length n and m queries. Each query gives an interval [l,r] and you need to calculate . How to solve this pro…