Comments

On registration page there is "Read the details in this post.", but post is inaccesible

On iNNNoCodeforces Round 951 (Div. 2), 2 years ago
+22

thanks!

+30

YES NO forces

just found this submission for D, and to me it seems very random. Can anybody explain why this part is correct (if it is) act=(act+seguentSalt[act]++)%mida

+3

1000000 1 1000000 1 1000000 1... causes tl for solutions that try to linear search next year every time

for (auto &i : mp), you just make a copy every time

Nice idea!

0

Yeah, it is confusing. But you can choose subsegment of length 1 if a[i] <= k

haha, for me it's much easier, but there're also short implementations of segment tree, so idk, let it be 100% faster =D. If you are in rush, then no worries about it, but of course I recommend you to learn it after, it's very cool data structure!

neutral is such element A that for any B, A*B = B. 0 + 5 = 5, or min(INT32_MAX, 5) = 5 for example. Yes segment trees can solve all of BIT problems, BIT is just easier to implement and faster.

There're a lot of quieries you can come up with and a lot of data strucutures for theses quieries. Segment tree supports all associative operations with neutral element. Fenwick Tree (BIT) supports only subset of these operations

Great contest! 2 problems with hello world solution is insane :D

in problem C you need to make some observations before that, so no

On Rajiun__nabiabout hacks, 4 years ago
+6

"rooms" are made to prevent it

0

I think answer is Infinity if sum of min(n, d) greatest A[i] >= C since we still can do different tasks

That is not true actually, atleast when using operator[] instead of .at()

Because of poor default hashing function. If you wanna use unordered_map or other data structures which are using hashing, write your own randomized hash function so it will be much harder to create such bad test-case for it. In this particular problem complexity nlogn of map is good enough to pass.

Try this: setvbuf(stdout, nullptr, _IOFBF, BUFSIZ);

I've played a bit with your code, and if you make #define double long double , it outputs correct answer on both compiliers. So, probably, there're some differences in the floating point treatment.

If you are stuck for a log time, you can try binary search