hey everyone. I have literally NO IDEA why this code gives me runtime error. It looks a little bit messy but pls help. thx in advance.
There are many reasons that people do cp here: 1. They are preparing for olympiads 2. They are training for some job interview 3. They become satisfied by becoming a GM, LGM, rank 1 competitor, etc… 4. they just enjoy solving problems because its fun and still do it even if they don't rank up or make money out of it! 5. Some other reason. I was wondering if anyone fits in the fourth category, so if you do please tell me in the comments!
Hi. Here's my solution for the latest div3 problem D : https://codeforces.com/contest/1385/submission/87172064
can somebody please help why it gets TLE? I checked my solutions with some accepted ones and the idea was the same.
Hello codeforces. I was solving this problem in EDU part that I faced a bug. as said in the video, to find the longest common substring of two strings s and t we should first build the suffix array of s + # + t. I did this and this caused me RE on test 2. and it turned out that the reason was the character # is smaller than the character (dollar) that we add to the end of the string at the beginning of building suffix array. but it was said that character (dollar) has to be the smallest character among all characters of the string. so to fix this issue we can use character ~ instead of #. and ~ is also bigger than character z. so we won't face any problem then. I wanted to make you aware of this.
Hello, I've realized in new codeforces contests that in lots of problems the input starts with an integer t ! the number of test cases,
so what is it used for ? why not just one test case instead of lots of them ? does it make judgement easier ? in past this way of representing input was not common, so what happened ? if you know answer to my questions above please answer in the comments :)
Hi guys! Here’s a problem I’m the author of it (and I don’t know the solution!) You are given a weighted tree with n nodes such that the weight of the ith node is w[i]. In each step you will do the following : Chose 2 adjacent nodes with weights V1 and V2. Delete the edge between them and put one of them on the other. Then the weight of the new node will be V1 + V2 and the cost of this action will be V1 + V2 as well. Now you are supposed to have a node with 0 adjacent nodes. What is the minimum cost of it?
So if you were given a tree with 2 nodes with weights 5 and 7 then the minimum cost would be 12.
I’ve not set any constraints yet but do your best on it! O(n * n) is preferred ...