C. Not Equal on a Segment time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array a with n integers and m queries. The i-th query is given with three integers li, ri, xi. For th…
A - Restoring Three Numbers CodeForces - 1154A Polycarp has guessed three positive integers aa, bb and cc. He keeps these numbers in secret, but he writes down four numbers on a board in arbitrary order — their pairwise sums (three numbers) and sum o…
C. Not Equal on a Segment 题目连接: http://www.codeforces.com/contest/622/problem/C Description You are given array a with n integers and m queries. The i-th query is given with three integers li, ri, xi. For the i-th query find any position pi (li ≤ pi …
B. Queries about less or equal elements Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/600/problem/B Description You are given two arrays of integers a and b. For each element of the second array bj you should find the num…
传送门: http://codeforces.com/problemset/problem/600/B Queries about less or equal elements time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given two arrays of integers a and b. For e…
http://codeforces.com/contest/1029/problem/A You are given a string tt consisting of nn lowercase Latin letters and an integer number kk. Let's define a substring of some string ss with indices from ll to rr as s[l…r]s[l…r]. Your task is to construct…
Description You are given two arrays of integers a and b. For each element of the second array bj you should find the number of elements in array athat are less than or equal to the value bj. Input The first line contains two integers n, m (1 ≤ n, m …
B. Queries about less or equal elements time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given two arrays of integers a and b. For each element of the second array bj you should fin…
C. Equal Sums time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given kk sequences of integers. The length of the ii-th sequence equals to nini. You have to choose exactly two sequen…
You are given a sequence of integers of length nn and integer number kk. You should print any integer number xx in the range of [1;109][1;109] (i.e. 1≤x≤1091≤x≤109) such that exactly kk elements of given sequence are less than or equal to xx. Note th…
You are given two arrays of integers a and b. For each element of the second arraybj you should find the number of elements in array a that are less than or equal to the value bj. Input The first line contains two integers n, m (1 ≤ n, m ≤ 2·105) — t…
Equal Rectangles time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given 4n4n sticks, the length of the ii-th stick is aiai. You have to create nn rectangles, each rectangle will con…
B Equal Rectangles 题意: 给你4*n个数,让你判断能不能用这个4*n个数为边凑成n个矩形,使的每个矩形面积相等 题解: 原本是想着用二分来找出来那个最终的面积,但是仔细想一想,那个面积只能是给出的4*n个数中的最小值和最大值的乘积,如果这两个长度不凑成一个矩形,那么肯定全部矩形的面积会出现不一致的 代码: 1 //The idea was to use dichotomies to find that area, and then use that area to figur…
C. Not Equal on a Segment time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given array a with n integers and m queries. The i-th query is given with three integers li, ri, xi. For th…
打开题目连接 题意:给2个数组(无序的)啊a,b,判断b数组中的每一个元素大于a数组中个数. ACcode: #include <iostream> #include <vector> #include <algorithm> #include <cstdio> using namespace std; vector<int> v; int main() { int x, n, m; scanf("%d%d",&n,&…
题目大意:有n座塔,塔高h[i],每次给定高度H对他们进行削切,要求每次削掉的所有格子数不能超过k个,输出最少削几次才能使所有塔的高度相同. 思路一:差分+贪心 对于每一个高度h,用一个数组让1~h的数,每一个都加一.用差分求一下后缀和可以完成. AC code: #include<bits/stdc++.h> using namespace std; typedef long long ll; ; ll arr[N]; int main() { ll n,k; cin>>n>…