Comments

It is not necessary intended, but in general you should write code that allows extra spaces, tabs, etc unless statement clearly states about exact gaps. I.e. "integers in lines are separated by a single space".

The only reason tests are not always being checked on such formatting is because code that fails on them is usually bad code.

Any time is not evening for more than half of timezones...

It is not any different. You have some precounted distances, use them instead of INF you use usually and run usual Dijkstra

My solution of E:

Let's just use Dijkstra algorithm with only roads. Now repeat next thing k times:

For each v:

dp[new_layer][v] = min(dp[previous_layer][v], minimum_of(cost_of_flight + dp[previous_layer][from]))

Run Dijkstra on updated distances

Answer for vertex i after k repeats is dp[k][i]

Submission using Li Chao tree for finding minimum_of(): 169168040

You can also use Li Chao tree (it is just advanced segment tree) Both are data structures that allows you to find minimum/maximum of linear functions' values in O(log(n))

Submitted same thing, but with O(n+m) complexity: 169137143

Never use doubles and floats if you can avoid it.

I succeeded to solve D2 using bit tree on two values: 168855514. I struggle to evaluate the complexity of this solution. Can somebody explain it to me? I guess there is some countertest for getting TLE

+14

typical chineese editorial

  1. There is one useless operation type.
  2. It`s better (general) to delete symbols while going right to left not left to right.
  3. You can solve task with O(n^2).

My solving: for each target number from least to biggest we trying to put this number to the vertices and check (using set and it`s size), is it smallest possible number and is it possible to put it to the current vertice.

Here is submission

Sorry for my english.

+11

Good statements, strong pretests, only me left stupid

I really enjoyed F statement

On Sulfox → Codeforces Round #635, 6 years ago
0

https://codeforces.me/contest/1304/problem/E

this one was interesting for me

On Sulfox → Codeforces Round #635, 6 years ago
0

because you done it so slow, that 10K people were fast

0

can`t find endlish version. will try to explain in messages

+1

No. 10^8 is ok.

0

When using one simple loop, you can iterate up to 10^9. 10^7 / 10^8 is TLE for python.

P.S. If you want, I can send you link to interesting problem, that have idea, that using up to 1.5 * 10^9 in 2 seconds and solution for it.

Cfn somebody explian why my E2 submission passed all the tests? It is really strange.

On Sulfox → Codeforces Round #635, 6 years ago
-8

It is also too late for some Russian regions. (I live in UTC+10. I waited for results of system tests till 5 am)

O(1) may be? Not O(n)..

Idea is good, but problem is obvious.

On McDic → Codeforces Round #633, 7 years ago
+3

No.

On McDic → Codeforces Round #633, 7 years ago
-10

Good round, great problems! But weak pretests on D. Test 31 is very short, but wasn't used in pretests...

Codeforces server went down few times and got stuck on 88%

I think, this is problem with Codeforces server. For last few hours Codeforces wasn`t avilable three times. Too much online during carantine

problem C first solution — wrong language (python code, linked as c++)

Very weak pretests on B. Counter overflow passed pretests and failed on test 56

02:05 am. nice.

also will be great to use brain