MikeMirzayanov's blog

By MikeMirzayanov, 9 years ago, translation, In English,
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
 
 
 
 
  • Vote: I like it
  • +8
  • Vote: I do not like it

9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
how can I know the number of the problem which my friends have solve?
9 years ago, # |
  Vote: I like it +7 Vote: I do not like it
Thanks for the really nice problems.
  • 9 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    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.
    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      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.
      • 9 years ago, # ^ |
        Rev. 2   Vote: I like it +1 Vote: I do not like it
        show me your code ( http://paste.ubuntu.com )
        may be I can help you
        • 9 years ago, # ^ |
          Rev. 3   Vote: I like it 0 Vote: I do not like it
          THANKS
          Here It is:
          I'm an absolute beginner in C#
          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I think you have trouble in this part of your code:

            <pre>

            if(input.Substring(i,2)=="at")
            {
            input=input.Substring(0,i)+"@"+input.Substring(i+2);
            }

            </pre>

            reread the statement carrefully ;)

            • 9 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it
              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 "@"
          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I think you have trouble in this part of your code:

            <pre>

            if(input.Substring(i,2)=="at")
            {
            input=input.Substring(0,i)+"@"+input.Substring(i+2);
            }

            </pre>

            reread the statement carrefully ;)

          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I think you have trouble in this part of your code:

            <pre>

            if(input.Substring(i,2)=="at")
            {
            input=input.Substring(0,i)+"@"+input.Substring(i+2);
            }

            </pre>

            reread the statement carrefully ;)

          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I think you have trouble in this part of your code:

            <pre>

            if(input.Substring(i,2)=="at")
            {
            input=input.Substring(0,i)+"@"+input.Substring(i+2);
            }

            </pre>

            reread the statement carrefully ;)

          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I think you have trouble in this part of your code:

            <pre>

            if(input.Substring(i,2)=="at")
            {
            input=input.Substring(0,i)+"@"+input.Substring(i+2);
            }

            </pre>

            reread the statement carrefully ;)

          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            I think you have trouble in this part of your code:

            <pre>

            if(input.Substring(i,2)=="at")
            {
            input=input.Substring(0,i)+"@"+input.Substring(i+2);
            }

            </pre>

            reread the statement carrefully ;)

        • 9 years ago, # ^ |
            Vote: I like it +1 Vote: I do not like it
          Here's my code for problem D, in case someone can spot my mistake. Thx in advance.
  • 9 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    really nice problems!

    thanks to authors and CodeForces!

    well done!

9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I think there will be many pepele died in problem B.

  • 9 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    Well, i've still not understood the problem statement for problem B
    !
    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      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.
      • 9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        A simple greedy algorithm works :D
        • 9 years ago, # ^ |
            Vote: I like it +3 Vote: I do not like it

          Yeah, the problem is simple .Many people make a mistake on what the problem mean.

      • 9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        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?
        • 9 years ago, # ^ |
            Vote: I like it +1 Vote: I do not like it
          Even if you can do so, the best possible thing to do is to buy once and sell once :D
          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            That's not true. In the test: 4 4
            1 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
            • 9 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it
              I don't get the point
              So finally, can I sell many times ?
            • 9 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it
              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.
              • 9 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                I did that, but get wrong answer on test 13. My solution was "I can only sell one time" and use greedy like that


                • 9 years ago, # ^ |
                  Rev. 2   Vote: I like it 0 Vote: I do not like it
                  I guess you greedy with the sub(maxPrice,minPrice);
                  Greedy it with the value of you can got with each sub();
          • 9 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            i find my bug, thank you very much.
9 years ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it
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?)
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    It's not a bug in codeforces. I'm writing these in Chromium.
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    The precase is good .The wrong code can pass it.
    So we have chance to hack it.......
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Can there be more than one word in problem A. I got my solution hacked but still cannot understand the reason
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
How is the Rating calculated? what about the colors (sergeant,lieutenant,etc) ?
9 years ago, # |
Rev. 3   Vote: I like it +1 Vote: I do not like it
what is D   test 5?
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Please give test case number 8,too
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    I got Presentation Erro in that one. I would really like to know what went wrong with it.
    • 9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      i have solved my bug .
      PE maybe  you can get the right value, but the wrong path.
      • 9 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        It could be. Anyway, that would be a confussing judge response, in that case a wrong answer should be expected.
9 years ago, # |
  Vote: I like it +1 Vote: I do not like it

admins answer my questions fast during contest , thanks for that.

9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
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?
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
http://paste.ubuntu.com/528330/


kindly let me knw my mistake......I got wrong answer for pretest 7.....poblem B
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    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.
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
what is the idea for solving problem E??
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Can you give the test 3 of the problem D? I  get  PE,I'm confused!
9 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
Hello. Does anyone know a good article(in english) about using envelopes in dynamic programming? I would really need one.
Thx
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
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. 
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
hi
please help me.
in B,What is mean bourles?
and
in C,what is pretest 5?
thanks
  • 9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    It's a new Russian currency. One bourle = 100 pokeikas  ≈  0.032 laddors.