Comments

tmw orz

Nice job!

I am sorry but may you please explain why everyone writes your handle? :D

You can open PR with the tests :)

I have tried the diophantine equation but no luck. What a bad problem for C..

On 3OOIQ → IZHO 2019 / Day 1, 8 years ago
0

I believe standings will appear there soon: https://izho.kz/results/

+2

On whipppedcream → Koalas at IOI 2018, 8 years ago
+18

Didn't your team also put kangoroos on some bags? :D

On gigabuffoon → IOI 2018 Scoreboard, 8 years ago
+37

Is it down again?

I think 'Collections.sort' is too slow to pass tests with big constraints.

On gKseni → ICPC World Finals 2018, 9 years ago
0

There are no ups without falls..

On tourist → Hello 2018, 9 years ago
+7

Lovely scoring distribution

On Broken_Soul → Doubt in DP, 9 years ago
0

Well, what if the value of n will be less than the value of k? Some of your dp[i] states will still be true.

On moejy0viiiiiiv → Any suggestions?, 9 years ago
+45

Guys, it is a prank! :D

On RockyB → Started prepare to IOI, 9 years ago
+31

Good luck, Zhan! I wish your dream come true!

On Lewin → Good Bye 2017, 9 years ago
0

After educational round

On Lewin → Good Bye 2017, 9 years ago
0

Good luck, everyone!

Difficulty is the same as Div2 problems

As always, solution for a problem is quite easy but why I can't come up with it..

Anyway, thanks for great problems!

On NBAH → Codeforces Round #448(Div.2), 9 years ago
+1

Well, it works in logN. So I think you both do not need to worry about TL

On NBAH → Codeforces Round #448(Div.2), 9 years ago
0

Explanation from AdiZer0 : The number is perfect square if all prime degrees are even. So you can do dp with bitmask since there is only 19 primes until 70.

On NBAH → Codeforces Round #448(Div.2), 9 years ago
0

Didn't know this fact, thanks)

On NBAH → Codeforces Round #448(Div.2), 9 years ago
0

How to solve C?

On NBAH → Codeforces Round #448(Div.2), 9 years ago
0

What is an idea behind your DP approach?

Same thing here..

On _Muhammad → How to improve my rating?, 9 years ago
+1

It is difficult to hear these words again and again but you need more practice. Read this and this. Good luck!

Well, your graph should be like a chain. If it is, just start to restore a string from a top of this chain one by one.

Your resultant string can not contain similar letters. For example, if you have "aba" where 'a' appears two times, it is already impossible to construct a string where "aba" will be the most frequent string. Now, using this fact, let's build a graph on letters of our strings. If we have a string "curd", that means we need to create 3 edges {'c' -> 'u', 'u' -> 'r', 'r' -> 'd'}. If such directed graph does not contain loops, just restore strings and output them in lexicographical order

If there are cycles, answer is NO. Otherwise, restore all strings and output them in lexocgraphical order. 32280888

There are no ups without falls.

In problem Div2E we also should take in mind that if s[i] is a prefix of s[i + 1] and len(s[i]) != len(s[i + 1]) then it is impossible to get the correct capitalization of letters.

On NAflash → Tourist, 9 years ago
+4

Real talk

I created the BFS algorithm by my own) It was required in the problem where fire was spreading in a maze) I coded about 200 lines of code :D

Why is it enough to take only (l — 1) as the additional case?

You know you are a programming competitions addict if when you see word "tourist" somewhere you think about a CP Legend)

Oh, sorry, there is no question anymore, i found out a mistake, here is AC solution : 27416622

May you please find a mistake behind a logic of my approach for problem C : 27416588

What a beatiful solution for D )

Easy to see :DD

On cwystc → NOIP2016, 10 years ago
0

好運

+3

I thinked it means Knapsack Problem)

Because of collisions unordered_map works with complexity O(n) in worst case while worst case for simple map is O(logN)

Your submissions were skipped because someone has the same code as you. Did you use ideone.com or other online IDEs? If yes, many people had a chance to copy-paste your solution(cheaters)

Можно пожалуйста вопрос про D. Предположим мы ходим по графу и разукрашиваем его, допустим текущая вершина покрашена в цвет 1. Далее мы продолжаем его разукрашивать, и каким-то образом идем по ребру веса 1 в эту же вершину и цвет не совпадает, мы сразу выводим "NO". Но разве мы не можем пойти по какому-нибудь другому пути, где их цвета совпадут? Почему это работает ?

On Matjaz → The best Codeforces problems, 10 years ago
-6

733C

Spoiler

Hmm, strange..

I got AC with the same idea, check this out

AC Code

0

May you please explain this part of solution for D?

Spoiler

Why in worst case there is only 9 prime factors??!

Oooh. ok)

Hm. I think this test case is wrong because "220 275 330" are valid sides

I tried to find a hack test case for O(n ^ 3) and O(n ^ 2) solutions.. :D

On Kniaz → Codeforces Round #392 (Div. 2), 10 years ago
+7

Absolutely agree) I think this type of problems is named as "constructive"

On Kniaz → Codeforces Round #392 (Div. 2), 10 years ago
+1

Guys, what is a type of problem C today? Is it math or just implementation? I have difficulties with this kind of problems

On Kniaz → Codeforces Round #392 (Div. 2), 10 years ago
+6

Good luck!)

Yes, and dp[i] = dp[i / 2] + dp[i / 2 + (i % 2)];

Hope this will help

+2

Also ready)

Solution from Marik

Let pref[i] be the maximum volume of liquid that we can get by doing some opreations on prefix i, the same for suf[i], but here we calculate maximum volume that we can get on suffix i.

Therefore,

pref[i] = v[i] + min(pref[i — 1], l[i])

suf[i] = v[i] + min(suf[i + 1], r[i])

Then iterate i from 1 to n and calculate this value:

ans = max(ans, suf[i] + pref[i] — v[i]).

Code: http://pastebin.com/rEQLM2zK

It makes your input/output more faster. It is really important to use it when you read big data. For example, when number of elements in your array reaches 2e5)

Your solution is right)

http://codeforces.me/contest/738/submission/22402437

I only added ios_base and it got 'Accepted' :DDDD

Instead of Thousands Words : Passed Pretests

Something More Than Just Lines of Code

On lkhntn → How to delete the account?, 10 years ago
+13

There is still no function for deleting account)

On the right side you should see "Codeforces Round #X", click on it

On dkjsfkhg → How can this happen?, 10 years ago
-13

Maybe people sent too many submissions and servers were overloaded

Auto comment: topic has been translated by ironsoul (original revision, translated revision, compare)

On akshit.lite → C++ 11 v/s C++ 14, 10 years ago
0

Strange thing This C++ 11 submission if faster than C++ 14 submission :D

On akshit.lite → C++ 11 v/s C++ 14, 10 years ago
0

Cool! May you please share good sources for learning a Swift programming language?

On vovuh → Codeforces Round #374 (Div. 2), 10 years ago
0

I feel so frustrated again because of not solving the C problem. During the contest, I did not have any thought about DP, I used only DFS...

+1

Here is a my method of solving Div2 C: I just wrote a really slow solution. I wrote it down on paper and tried to found consistent pattern. To be honest, I do not know why my solution works but it got "ACCEPTED".

int n;
	cin >> n;
	BigInt dp[n + 1], st, e, s;
	dp[1].read("2");
	dp[2].read("17");
	st.read("14");
	e.read("8");
	s.read("6");
	for (int i = 3; i <= n; i++) {
		BigInt d = dp[i - 1] - dp[i - 2];
		d += st;
		dp[i] = dp[i - 1] + d;
		if (i == 3) {
			st += e;
		} else {
			st += s;
		}
	}
	for (int i = 1; i <= n; i++) {
		dp[i].print();
		cout << '\n';
	}

Cartesian tree is slower than segment tree because of constant that appears from "Merge" and "Split" functions. For example, if you want to insert some element, you need split your tree by key and merge. It means that operaton works O(2*log(N)).

Because if on some prefix sum is [S/3] we should add all the methods of getting exactly this sum on our suffix. Why [i + 2]? Because we should have 3 parts with exactly the same sum.

+5

Your code works O(M*N). Therefore, in worst case your program makes 10^10 operations. Obviously, TLE happens. Try to think about more optimal solution. Hint: optimal solution should work O(N + M)

On Jakymoon → Coding Environment, 10 years ago
+10

Far Manager

May you please share with online judges on which you solved a lot of problems?)

My congratulations. May you share with us how you achieved this hard aim? )

On PrinceOfPersia → Codeforces Round #362, 10 years ago
+8

You always share photos with hands... :D

On Shibbir001 → annoying runtime error, 10 years ago
0

For (it = s.begin(); it != s.end(); it++)

If ... s.erase(it)

Here is a mistake. you are not allowed to change the size of your set in FOR loop. be careful and use debugger

On thevillager → How Does Hacking Works ?, 10 years ago
0

If you submitted your solution during contest and did not get WA or TLE, you have a chance to block your solution. After that you can open programs of any participant from your room(room will be choosen randomly) and if you see some mistake you should write a test which can prove that this solution is wrong. If counter-test is correct, you will get 100 points) Good luck!

Do not want 4/5. You should solve at least 5!)

Thanks a lot!

Try to use Debugger, i think that somewhere your program calls defunct element of array like num[-1] or num[10000000]

  1. How should we start the contest to win gold medal? //Maybe some tips that you can use before(like eating a chocolate or smth like that)

  2. Should we always start with most easiest problem?

3.After which time should we stop solving some difficult problem? Maybe, you always get WA on test 5, do not give up, but time decreases too.

4.How much time do you spend for training per day?

Thanks for posts like that, it gives us a motivation!

Some problems which you can try to solve with binary search: http://codeforces.me/problemset/problem/670/D2 http://codeforces.me/problemset/problem/371/C

Good luck!

0

The same thing. Never passed it before :D