MikeMirzayanov's blog

By MikeMirzayanov, 15 years ago, translation, In English

Hello!

This contest has been prepared by Artem Rakhov and other participants of Petrozavodsk Training Camp from Saratov State University. We stopped solving problems of the camp, missed the lecture by Vitaly Goldstein (do not be angry, Vitaly), but the round has been prepared and we are waiting for you - the participants.

Happy hacking,
MikeMirzayanov and team Codeforces

UPD:

  • Vote: I like it
  • +47
  • Vote: I do not like it

| Write comment?
15 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it
Thanks for the nice problem C
15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
What is final test 16 for B?
  • 15 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it
    you can see(or will can some later) tests by clicking to ID in "My submissions"
    • 15 years ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it
      It is so strange:


      Test: #16, time: 50 ms., memory: 2688 KB, exit code: 0, checker exit code: 2, verdict: WRONG_ANSWER
      Input
      509149
      Output
      1
      Answer
      509149 1
      Checker Log
      wrong output format Not sorted and uniqued

      What's wrong with this answer? It is looks like all is ok (sorted and unique)
15 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it
Can someone please explain the solution for problem E?
15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
Can any one explain the logic behind problem C ?
15 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it
Are there going to be more competitions soon?
15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
All of my accepted solutions gave runtime error in the final testing :(

Please tell my error...

And my solution for C got WA for pretest 6. I used the same algorithm as above.
  • 15 years ago, hide # ^ |
     
    Vote: I like it +3 Vote: I do not like it
    In Problem A you use array a with size 100 --> char a[100]
    but you must use char a[101], because the maximum length of string is 100 and the end of this string must fill by 0.
    sorry for my poor english.
    • 15 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      ah great... an extremely stupid mistake to make... any idea about B?
      • 15 years ago, hide # ^ |
         
        Vote: I like it +3 Vote: I do not like it
        you must initialize the arry a with false. like this:
        memset (a, false, sizeof a);
        because your array is local and maybe not have false value. therefore the primes are incorrect and maybe have 0 value or no primes have value greater than n.
  • 15 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it
    Problem A: try to put a[101],because strlen("dejap") = 5, and you string is 0..4. So when there is a word of 100 chars your array cant access a[100] because it contains only 0..99.
    Problem B: try to declare arrays out of main function (global)
    Hope it helped.
    • 15 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      How will declaring arrays out of the main function help? I haven't tried it out yet but still... how should that make a difference?
      • 15 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it
        Sometimes when there are big arrays in functions it generates stack overflow... It is better to declare static array which is initially filled with zeros. So it is safer. My compiler cant even compile your code until I put that 1M array out of main.
        Hope it helped. :) 
  • 15 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it
    In problem B u r trying for a loop of O(10^12) thats an  obvious reason for crashing ur program.
    • 15 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it
      The time complexity of my program is O(nlogn). The sieve (the only thing which you could be talking about) has complexity of O(nlogn).
15 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it
Who can explain the main idea to solve E?
15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

goh tu in emtehanu!

15 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
No contests coming up soon?