Given n 2d points
(x,y) , x<=1e5 , y<=1e5
n<=1e5
find the number of triplet such that all x's are different and all y's are different
ex: valid triplet is (1 , 3) , (2 , 2) , (3 , 1)
pLease share some ideas how to solve it
Thanks in advance
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Given n 2d points
(x,y) , x<=1e5 , y<=1e5
n<=1e5
find the number of triplet such that all x's are different and all y's are different
ex: valid triplet is (1 , 3) , (2 , 2) , (3 , 1)
pLease share some ideas how to solve it
Thanks in advance
Problem Description
You love strings a lot, so you decided to play the following game.
You have a tree T of A nodes. The tree is represented by a matrix B of dimensions (A — 1) * 2 such that there exist an edge between node B[i]|1| and B[i][2]
Each node is assigned a lowercase english character, which is represented by a string C of length A. Node is assigned character at position i of string C. You are given Q queries in the form of a matrix D of dimensions Q * 2 For each you query you will perform the following steps:
You will move from node p[i][1] to node D[i][2] using the shortest possible path.
Let V[1], V[2]...V[K] be the nodes visited in the corresponding order. Create a string $ such that length of S is equal to K and S[i]=c[v|i]]
Store string S in your bag.
Return the number of unique strings you would create.
Problem Constraints
I <= A <= 10 ^ 5
B is a matrix of dimensions (A — 1) * 2
Feel free to share aprroaches Thanks in Advance
1<=B[i][1] , B[i][2] <= A
length(C) = A
Conly contains lowercase english alphabets
1 <= Q <= 10 ^ 5
D is a matrix of dimensions Q * 2
1<=D[i][1],D[i][2]<=A
Given the m ranges that denotes subarray of an array of length n i --> [l ,r] 1<=l<=r<=n Cost of Concatination of two ranges is 1 Find the min cost to overlap the whole array or return -1 if not exist
1<=n<=100
Plz help. Thanks in advance
We are given an array of size n and we have to determine if it is possible to arrange the elements in such a way that the absolute difference between two adjacent elements is 1.The first and the last element are also considered adjacent. for example, for array A=[1,2,3,2] the answer is YES. Thanks in advance.
You are given an array A of size N. A special number of a subsequence S is a number formed by the concatenation of all the elements of the subsequence S.
Find the count of non-empty subsequences of A having their special number divisible by X and of length K. Since the answer can be huge, output it modulo 10^9+7
I dont know How to start this Plzz help??
Constraint:- 1 <= T <= 10 1 <= N <= 10^3 2 <= X <= 20 1 <= A[i] < 1000 1 <= K <= 100
static bool comp(string a ,string b){ return a.size()<=b.size(); }
I used this in leetcode But this gives Error "terminate called after throwing an instance of 'std::length_error' "
after changing it to --> a.size()<b.size() this works How this works????
Название |
---|