Given, two binary number A and B (A > B). Each of A and B can have at most 10^5 digits. You have to calculate (A^2 — B^2). [Here, (A^2) denotes the A power of 2].
What should be the approach to calculate A^2?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
Given, two binary number A and B (A > B). Each of A and B can have at most 10^5 digits. You have to calculate (A^2 — B^2). [Here, (A^2) denotes the A power of 2].
What should be the approach to calculate A^2?
Suppose, there's n persons A1,A2,....,An. Person Ai have a set of p_i_ numbers, Xi.1,Xi.2,....,Xi.pi. You have Q quaries. Each quary is two types.
1 in t S1 S2 .... St.
Set p_in_ with t and Xi with S.
2 l r m S1 S2 ... Sm.
Calculate the number of people Al...Ar, who has at least one number Si in his set p_i_
1<=n,Q<=100000
1<=p_i_,t,m<=20
1<=Si,each element of Xi<=1000000
How can be it solved?
N.B.: Its a problem of an onsite contest occured 2 weeks ago.
Название |
---|