### Kamfucius's blog

By Kamfucius, history, 2 years ago,

Hello, I was solving golf from JOI 2017 Open. I tested in polygon with author's solution. My solution got WA, then I decided to change C++17 to C++14 and magically I've got AC. Can someone tell me how is that possible. Also I submitted it to oj.uz where compiler is under Ubuntu and it also gives wrong answer code test

• -24

By Kamfucius, 3 years ago, translation,

You are given 4 integer arrays A, P and B, Q of size N and M queries. Initially, elements of A and B are 0, and elements of P and Q are sorted in non-decreasing order and have constraints 0 ≤ x ≤ 109.

There are 3 types of queries:

• 0 ≤ x ≤ 109; 1 ≤ i ≤ N; Ai = x
• 0 ≤ x ≤ 109; 1 ≤ i ≤ N; Bi = x
• 0 ≤ x ≤ 109; 1 ≤ y ≤ 1018; Find minimum i, such that

There is an easy solution with time complexity O(Nlog2N): store A and B in BIT, when you need to answer query, binary search by i, and check whether condition holds true. I'm looking for solution with time complexity O(NlogN). Any ideas about that?

• +14

By Kamfucius, 3 years ago,

Hello Codeforces!

I’d like you to invite for CodeChef June Lunchtime that will start at 19:30 IST of 24-th June 2017 (check your time zone here) and will last 3 hours.

The author of problems is me, grumpy_gordon, while lewin is a tester and mareksom is the secondary Tester. The editorialist is pkacprzak. Translators: CherryTree (Russian), huzecong (Mandarin) and VNOI team (Vietnamese).

There is no registration required, anybody with a CodeChef handle can participate. Top school participants can win CodeChef laddus (details on the contest page).

You will be provided 4 problems with subtasks (IOI-style grading). Ties are broken by time of reaching your final score.

Remember about subtasks if you can't solve a problem for the full score, and read the editorial after the contest.