Can you please suggest problems which are based on segments, intervals, line sweep (for intervals etc), like this one. How to find such problems on codeforces or other judges? Thanks!
# | User | Rating |
---|---|---|
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 |
# | User | Contrib. |
---|---|---|
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 | djm03178 | 152 |
Can you please suggest problems which are based on segments, intervals, line sweep (for intervals etc), like this one. How to find such problems on codeforces or other judges? Thanks!
Suppose for a function f(x) , for different values of x , f(x) is a bool value yes(y) or no(n) as:-
$$$nnnnnyyyyynnnnn$$$
Also suppose the check function in bsearch returns (-1) if its in the left 'n' block , (0) if its a 'y', and (1) if its in the right 'n' block.
So I need to find the largest value of x for which f(x) is yes(y). Is it doable by binary search?
(Usually we have f(x) varying as $$$yyyyyynnnnnn$$$ or $$$nnnnnnyyyyyy$$$ and in that we can easily use bsearch.)
Given array of n elements. Find the number of pairs i, j (1 ≤ i < j ≤ n) such that gcd(ai,aj) = 1.
Constraints are: 1 ≤ N ≤ 30000, 1 ≤ a i ≤ (10^8). TL = 0.6s
One user has explained the solution here but I am not able to understand how subsets are used in the solution and the time complexity part.
If someone can please explain, it would be of much help. Thanks in advance!
Name |
---|