# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3741 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3442 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
2 | atcoder_official | 162 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
Name |
---|
It would be a good idea to add tutorial link in contest page.
what does the function root() in problem C solution
sorry for the question. I understand all the thing.
C's time limit was stupidly strict. 36551515 is TLE(runs in about 2.15 seconds), while 36625920 is AC. The only difference was adding special cases if the exponent>=30.
Well, usually time limits are set 2-3 times as authors' solutions. As you can see, my solution (without any optimizations) runs in ~700 ms.
36551515 is TLE due to endl & flushes. 36629869
In problem C, my question is when there are much more element need to be inserted in a container so "should we prefer vector on the place of the set?" in c++.
because of the same thing I implemented using set giving TLE and by vector AC
Can anyone please tell me why are we disposing sqrts in problem c
There are 10^9 squares in the range [1..10^18], so we can't just store them to answer our queries. But floor(sqrt(x)) is a number of squares in the range [1..x], so, we just calculate floor(sqrt(R))-floor(sqrt(L-1)) to know how many squares are in the range [L..R]
Problem D can be solved by KMP with O(n) time complexity.
question C can be easily solved by using the Mobius function (inclusion-exclusion of numbers l<=x<=r that can be generated in several ways). However, this solution requiers accuracy of the pow function and in test 5 (very big numbers) I get an off-by-one solution. How can one use the pow function to get the actual floor of the result even if the base is 10^18?
You can test it manually.
Imagine that the number returned by pow is x. Then test xp, (x + 1)p and (x - 1)p and choose the one that satisfies the conditions.
GreenGrape. In question 955C, how do u take care of the repetitions like 1000^2,100^3 which are basically 1000000, but show up in both squares and cubes. Thank you.
I exclude all squares from the set of powers greater than two after I generate them.
Then, how about 3^15, which shows up in both powers of 3 and 5. Are you keeping track of the ones chosen from power of 3 onwards. Thanks
They’re stored in a c++ set which doesn’t allow multiple instances.
By saying 'Let f3(u) will be minimal k, such that heapk(u) is equal to 3.', I guess you actually mean to say 'maximum k'?