```
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
```

# | User | Rating |
---|---|---|

1 | jiangly | 3677 |

2 | Benq | 3601 |

3 | ecnerwala | 3542 |

4 | maroonrk | 3540 |

5 | cnnfls_csy | 3539 |

6 | orzdevinwang | 3493 |

7 | inaFSTream | 3478 |

8 | Um_nik | 3430 |

9 | Rebelz | 3409 |

10 | Geothermal | 3408 |

# | User | Contrib. |
---|---|---|

1 | maomao90 | 174 |

2 | adamant | 164 |

3 | awoo | 162 |

4 | TheScrasse | 161 |

4 | SecondThread | 161 |

6 | nor | 159 |

7 | maroonrk | 158 |

8 | Um_nik | 156 |

9 | BledDest | 145 |

9 | Geothermal | 145 |

```
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

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????

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/24/2024 19:43:00 (l1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|