0w1

Entries from 2016-08-18 to 1 day

CFR 595 C. Warrior and Archer ( Ad hoc, Game )

Problem - C - Codeforces I really enjoyed this problem, for it did not require much code, and the solution is actually simple despite the fact that it needs some creativity( seems like being able to solve ABC before 70 min will have placed…

CFR 689 D. Friends and Subsequences ( Binary Search + Sparse Table RMQ )

Problem - D - Codeforces When there are functions, try to find the monotonic property. Both max function and mix function have monotonic property, for the former is non-decreasing and the latter is non-increasing. We are interested of the …

CFR 689 C. Mike and Chocolate Thieves ( Binary Search )

Problem - C - Codeforces If the first person took a, then the one who took most would have taken a * k^3. The restriction is essentially a * k^3 ≤ n, k > 1, a ≥ 1 If n is fixed, the count of valid ( a, k ) will be And since we want to sear…

CFR 689 B. Mike and Shortcuts ( Shortest Path )

Problem - B - Codeforces Well, it's easy. But not what I had expected for pB in division 2. And since the transition cost is constant, bfs = queue was enough, and priority_queue was kind of overkill. void solve(){ int N; cin >> N; vi A( N …

CFR 689 A. Mike and Cellphone ( Ad hoc )

Problem - A - Codeforces Trickiest problem in division 2 ever. There were many different solutions, mine is a little easier than most of them. Consider with 0 and without 0. If there is no 0, it is essentially asking whether there are at l…