MikeMirzayanov's blog

By MikeMirzayanov, 12 years ago, translation,
Hi, everybody!

Welcome to the  "Codeforces Beta Round #40 (Div. 2)". Let the weather cloudy (at least in Saratov), and the round began with the unavailability of the server (we apologize for a fail), but I hope the tasks will bring you pleasure.

Wish you high ratings,
MikeMirzayanov

• +8

 12 years ago, # |   0 how can I know the number of the problem which my friends have solve?
•  12 years ago, # ^ |   0 Click "Friends Standings" on the standings page.
•  12 years ago, # ^ |   0 Where do I add my friends?
•  12 years ago, # ^ |   +1 Go to their profile and click on the star next to their name.Their profile is found at:http://www.codeforces.com/profile/yourfriendsusername
•  12 years ago, # ^ |   0 Thank you so much!
 12 years ago, # |   +7 Thanks for the really nice problems.
•  12 years ago, # ^ |   +1 Problems were nice. Even though the round was unrated for me, I would like to know what made me got a Presentation Error in Pretest 5 in problem D.
•  12 years ago, # ^ |   0 And I want to know what was pretest 5 of problem C. I submitted my C# code and got WA. I wrote the same thing with C++ and got acc.
•  12 years ago, # ^ | ← Rev. 2 →   +1 show me your code ( http://paste.ubuntu.com )may be I can help you
•  12 years ago, # ^ | ← Rev. 3 →   0 THANKSHere It is:I'm an absolute beginner in C#
•  12 years ago, # ^ |   0 I think you have trouble in this part of your code:
if(input.Substring(i,2)=="at")                                {                                        input=input.Substring(0,i)+"@"+input.Substring(i+2);                                }
•  12 years ago, # ^ |   0 What's wrong with it?input.Substring(0,i) is from index 0 to i-1 and input.Substring(i+2) is from i+2 to end. "at" at indexes i & i+1 was replaced by "@"
•  12 years ago, # ^ | ← Rev. 2 →   0 I just understood it.You're right :DI have a missing break
•  12 years ago, # ^ |   +4 yep :)small mistake.
•  12 years ago, # ^ |   0 but what will be the answer for such test:dotdotatatatatatatatdotdot?
•  12 years ago, # ^ | ← Rev. 2 →   +1 The ans:  dot.@atatatatatat.dot  (Sorry! you did not ask the really ans. My mistake)
•  12 years ago, # ^ |   0 dot.@atatatatatat.dot вот ответ на этот тест
•  12 years ago, # ^ |   +5 в вышеприведенной программе ответ не был бы таким :)
•  12 years ago, # ^ |   0 I think you have trouble in this part of your code:
if(input.Substring(i,2)=="at")                                {                                        input=input.Substring(0,i)+"@"+input.Substring(i+2);                                }
•  12 years ago, # ^ |   0 I think you have trouble in this part of your code:
if(input.Substring(i,2)=="at")                                {                                        input=input.Substring(0,i)+"@"+input.Substring(i+2);                                }
•  12 years ago, # ^ |   0 I think you have trouble in this part of your code:
if(input.Substring(i,2)=="at")                                {                                        input=input.Substring(0,i)+"@"+input.Substring(i+2);                                }
•  12 years ago, # ^ |   0 I think you have trouble in this part of your code:
if(input.Substring(i,2)=="at")                                {                                        input=input.Substring(0,i)+"@"+input.Substring(i+2);                                }
•  12 years ago, # ^ |   0 I think you have trouble in this part of your code:
if(input.Substring(i,2)=="at")                                {                                        input=input.Substring(0,i)+"@"+input.Substring(i+2);                                }
•  12 years ago, # ^ |   0 OMG! What was that??
•  12 years ago, # ^ |   +1 Here's my code for problem D, in case someone can spot my mistake. Thx in advance.
•  12 years ago, # ^ |   0 I can't see any code
•  12 years ago, # ^ |   0 Sorry, I forgot to paste the link :(http://paste.ubuntu.com/528290/
•  12 years ago, # ^ |   +1 really nice problems!thanks to authors and CodeForces!well done!
 12 years ago, # |   0 I think there will be many pepele died in problem B.
•  12 years ago, # ^ |   +1 Well, i've still not understood the problem statement for problem B!
•  12 years ago, # ^ |   0 I missed "not more than once" .The problem mean you can buy and sell only one time or did not do it.Find the max value you can got.
•  12 years ago, # ^ |   0 A simple greedy algorithm works :D
•  12 years ago, # ^ |   +3 Yeah, the problem is simple .Many people make a mistake on what the problem mean.
•  12 years ago, # ^ |   0 I think i can only buy once and sell once before.But finally i got WA...Does the problem means, i can buy many times, but sell only once?
•  12 years ago, # ^ |   +1 Even if you can do so, the best possible thing to do is to buy once and sell once :D
•  12 years ago, # ^ |   0 That's not true. In the test: 4 41 2 1 2 you could get more than 8 using 2 sells and buys. By the way, that's a test, which gave me 3 hacks :P
•  12 years ago, # ^ |   0 I don't get the pointSo finally, can I sell many times ?
•  12 years ago, # ^ |   0 No, You simply can't
•  12 years ago, # ^ |   0 I did not got the point either.You can sell only "not more than once".
•  12 years ago, # ^ |   0 that means, you can only sell once!!!
•  12 years ago, # ^ |   0 we can not use 2 sells! the statement say only 1 sell....when greedy, use:    int cas = b / min[i];    int t = b + cas * (data[i] - min[i]);    if (t > max) max = t;min[i] is the min number in the left side.
•  12 years ago, # ^ |   0 I did that, but get wrong answer on test 13. My solution was "I can only sell one time" and use greedy like that
•  12 years ago, # ^ | ← Rev. 2 →   0 I guess you greedy with the sub(maxPrice,minPrice);Greedy it with the value of you can got with each sub();
•  12 years ago, # ^ | ← Rev. 2 →   0 Yup, like that, I find max value of sub(nowPrice,minPriceTillNow) ,after that result = (b / minPrice) * goodPrice + (m % minPrice);
•  12 years ago, # ^ |   0 Sorry ,I didnt say correctly.you should greedy the value.value = (b/minPrice)*maxPrice+b%minPrice;not (maxPrice-minPrice);
•  12 years ago, # ^ | ← Rev. 2 →   0 thanks, I greed the wrong thing :)) ===> dead
•  12 years ago, # ^ |   0 I forgot this, my codehttp://paste.ubuntu.com/528303/
•  12 years ago, # ^ |   0 Change your loop from single to twice.for (int i=0; i
•  12 years ago, # ^ |   0 i find my bug, thank you very much.
 12 years ago, # | ← Rev. 4 →   0 Looks like a lot of people misread problem B and thought that you could sell as much as you wanted.(bug: commenting seems to not work (comment is blank) from chromium?)
•  12 years ago, # ^ |   0 It's not a bug in codeforces. I'm writing these in Chromium.
•  12 years ago, # ^ |   0 The precase is good .The wrong code can pass it.So we have chance to hack it.......
 12 years ago, # |   0 Can there be more than one word in problem A. I got my solution hacked but still cannot understand the reason
•  12 years ago, # ^ |   0 Can there be more than one word in problem Anope
•  12 years ago, # ^ |   0 ok then here is my solutionhttp://paste.ubuntu.com/528284/Kindly explain the problem.
•  12 years ago, # ^ |   0 aaaIs the contr-example.BTW - it's my first contest on Codeforces, so i think i should say 'hello' to everybody, and thank you for the exciting contest!
•  12 years ago, # ^ |   0 the length of the string a and the string b can be different.
•  12 years ago, # ^ |   0 my code: http://paste.ubuntu.com/528287/:)
•  12 years ago, # ^ |   0 thanks for the replies friends. i thought that the lenght would always be same. Silly me :|
 12 years ago, # |   0 How is the Rating calculated? what about the colors (sergeant,lieutenant,etc) ?
•  12 years ago, # ^ |   +1 See this post about raiting and this about colors.
 12 years ago, # | ← Rev. 3 →   +1 what is D   test 5?
•  12 years ago, # ^ |   0 Please give test case number 8,too
•  12 years ago, # ^ |   0 I got Presentation Erro in that one. I would really like to know what went wrong with it.
•  12 years ago, # ^ |   0 i have solved my bug .PE maybe  you can get the right value, but the wrong path.
•  12 years ago, # ^ |   0 It could be. Anyway, that would be a confussing judge response, in that case a wrong answer should be expected.
 12 years ago, # |   +1 admins answer my questions fast during contest , thanks for that.
 12 years ago, # |   0 I found an interesting thing .When we reply a comment, the length of line is shorter than the parent comment.If we reply the new comment again and again. Will it only print one charactor each line?
•  12 years ago, # ^ |   0 it will only print one word each line :D
 12 years ago, # |   0 http://paste.ubuntu.com/528330/kindly let me knw my mistake......I got wrong answer for pretest 7.....poblem B
•  12 years ago, # ^ |   0 I think you dont need here any sort function.this problem (in my opinion) needs to be solved in one(may be two) for loops - thats all.
 12 years ago, # |   0 what is the idea for solving problem E??
•  12 years ago, # ^ |   +6 Problem E is solved by Turan's theorem:As said in Wikipedia: the n-vertex triangle-free graph with the maximum number of edges is a complete bipartite graph in which the numbers of vertices on each side of the bipartition are as equal as possible.so something like this works:
 12 years ago, # |   0 Can you give the test 3 of the problem D? I  get  PE,I'm confused!
•  12 years ago, # ^ |   0 Test 3 is from the problem statement.
 12 years ago, # | ← Rev. 2 →   0 Hello. Does anyone know a good article(in english) about using envelopes in dynamic programming? I would really need one.Thx
•  12 years ago, # ^ |   0 I'm not sure what envelope means in this case but maybe this will be interesting for you: http://codeforces.ru/blog/entry/325
 12 years ago, # |   0 Some points for Problem D. I think some people may need it.1. The input data: the first line is the top of chessboard and the last line is the bottom.2. When you got the max peas value is 0, it has a path, shouldn`t be print -1.(Some people WA on 51 maybe this reason)3. A 3rd_DP alogrithm can work .dp[ i ][ j ][ k ] express the max peas you can get at point ( i, j ) and the sum%( n+1)==k.
 12 years ago, # |   0 hiplease help me.in B,What is mean bourles?andin C,what is pretest 5?thanks
•  12 years ago, # ^ |   0 It's a new Russian currency. One bourle = 100 pokeikas  ≈  0.032 laddors.
 » 3 years ago, # |   -16