nevidomy's blog

By nevidomy, 13 years ago, translation, In English
Good evening!

Congratulation to all on the day of student, calm sessions, easy exams and a lot of new knowledge! I also want to congratulate those girls (women) whose name is Tatiana on their Angel Day.

I am glad to invite you to participate in Codeforces Beta Round 53. Today's round was prepared Michael Mirzayanov, Nevidomy Vitaliy, Artem Rakhov and Maria Belov, problems author is nevidomy.

Contest is over.
Congratulations to the winner: tourist. After the round he becomes first "General" of Codeforces!!! Link to results: http://codeforces.com/contest/57/standings


Nevidomy Vitaliy and Codeforces team.
Announcement of Codeforces Beta Round 53
  • Vote: I like it
  • +84
  • Vote: I do not like it

| Write comment?
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Thanks for the early English post!
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I'm trying to hack, but when I click on an run ID, no window pops up... is there some other way to see others' code?
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    I even tried going manually to the URL http://codeforces.com/contest/57/challenge/<RUN ID>, and no code shows up or anything. I've definitely locked the problems I'm trying to hack...
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      are victims of your hack from your room?
      • 13 years ago, # ^ |
          Vote: I like it +1 Vote: I do not like it
        Ha, not at all. This is my first time with the beta rules. I forgot we were divided into rooms. Thanks!
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Is there a way to go out of the competion? I tried to solve one problem, but then my ant came and now I only have 20 minutes left, I think my rating will fall down like an exponential function :(.
  • 13 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it
    (only)if you tried to submit any problem your results will be rated.
  • 13 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it
    You have a pet ant ? :p
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      My thoughts exactly. I would understand the distraction if it was a mosquito, or maybe a wasp... but I think you could distract an ant with a few bits of sugar and deal with it later.
      • 13 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        I was just kidding ;) ... he must have meant 'aunt'
  • 13 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it
    may be you meant "aunt" ? :P
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      It is interesting what huge diffenrence a small typing mistake can make. :)
13 years ago, # |
  Vote: I like it +30 Vote: I do not like it
Really nice problemset:) Thank you. It is great to see here other fans of Family guy:P
13 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
It seems the test case 7 in problem D is not valid:  (By mistake, the "..." in the last means ellipsis,but the same as "." in data)
Test: #7, time: 10 ms., memory: 48516 KB, exit code: 0, checker exit code: 1, verdict: WRONG_ANSWER
Input
47 24
........................
........................
........................
........................
........................
........................
X.......................
........................
....X...................
..........X......
Output
23.6657545509435892
Answer
23.670250896057
Checker Log
wrong answer 1st numbers differ - expected: '23.6702509', found: '23.6657546', error = '0.0001900'
13 years ago, # |
  Vote: I like it +3 Vote: I do not like it
It is the first time that my score is not changed after a contest.....冏
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Is there a way to see what hacked my code?
MY problem C was hacked, but the same code passed the system test after the competition.
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    The admin didn't add the hack data to the system test?
    • 13 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it
      Now I know the hack data.
      But my bad code passes the system test.
      • 13 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        But how to get the hack data?
        • 13 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          Sorry.
          I didn't get the hack data which was actually used to hack my code.
          I found only what kind of test case hacked my code by viewing my code with cmd's advice.
          I don't know how to get the hack data.
  • 13 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it
    try 59052
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      i hacked one guy with that test too :)
      • 13 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        What is so special about this test?
        • 13 years ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it
          (someValue - n) % m < 0 in this test

          more tests:
          59052
          80316
          96493

          I bruteforce my solution over all n for this bug and hack few people on this
        • 13 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          negative numbers.
          ans = (2*ans - n)%mod

          in my case, victim wrote
          if (ans<0) ans+=n;
          instead of
          ans+=mod;

    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Thank you.
      My code returns -27166.
    • 13 years ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it
      I got 3 hacks with this case. One of them was lucky and hadn't close his submissions yet and could correct it.
  • 13 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it
    It is impossible to consider all probable bugs. We are working on automatic adding of all the hacks in the final tests. It will be introduced soon.
    • 13 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it
      That's good news!
    • 13 years ago, # ^ |
        Vote: I like it +5 Vote: I do not like it
      I know that CodeForces has already hosted many contests in this format but
      I would like to give a suggestion to change a little bit the hacking system.

      I think it's pretty unfair that someone gets the lucky of having his solution hacked and get a chance to resubmit while others don't. Taking it to the extrem it can even be seen as working in teams.

      But, I also thing that it's nice this hacking phase during the programming phase and also the locking feature is important to allow resubmissions if someone noticed a mistake in his own solution before seeing others.

      So, my suggestion is to don't tell the contestant that his solution has been hacked until he locks it.  He can still resubmit but he needs to recheck the code and find his mistake without other people helping him. 
      • 13 years ago, # ^ |
          Vote: I like it +3 Vote: I do not like it

        I give you my opinion.

        Today's hack system looks for me as in real life: if someone noticed bug, he will say about it to the author. Or he will wait till the bughaver released his software with this bug, and only after that he says "I saw a bug in your program but didn't tell :p!"? Looks strange if this is a situation in one company, community, like CodeForces are. :-) Yes, you're right, it's a teamwork. :-)

13 years ago, # |
  Vote: I like it +3 Vote: I do not like it
Very nice problem D...
Kudos to the author.
13 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it
Can someone explain me how can i solve the C problem because i have no ideea better than O(N^2)? Thx
Edit: look here for solution: http://www.codeforces.com/blog/entry/1169
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
I want to ask...why is c++ compiler giving garbage value....when I use memset()...or malloc() ??
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    It was working correctly in my system!!
    • 13 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      memset is fill bites, not sell of bites. 

      int a[10]; memset(a,1,sizeof(a)); 

      give a[0]=...=a[9] = 00000001 00000001 00000001 00000001 = 16843009

      • 13 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        I initialised with 0

        see


        #include <iostream>
        #include <cstdlib>
        #include <string.h>

        using namespace std;

        int main()
        {
           
        long long int n=0,m=0,k=0,soln=0;

           
        long long int *v;
           

            cin
        >> n >> m >> k;

            v
        = (long long int*)malloc(sizeof(long long int)*n);
           
        memset
        (v,0,sizeof(v));

           
        for(int i =0 ; i < m;i++){
               
        long long int a=0,b=0,c=0;
                cin
        >> a >> b >> c;
               
                v
        [a-1]+=c;
               
        long long int f=0;
               
        for(int j=a;j<b;j++){
                    f
        ++;
                    v
        [j]=v[j]+c+f;

               
        }  

        //      for(int i=0;i<n;i++){
        //          cout << v[i] << endl;
        //      }
        //      cout << endl << endl;
           
        }

        //  for(int i=0;i<n;i++){
        //      cout << v[i] << endl;
        //  }
           
        for(int i=1;i<=k;i++){
               
        long long int t;
                cin
        >> t;
                soln
        = soln+v[t-1];
           
        }

            cout
        << soln << endl;
        }





        whereas...similar code...this one....

        #include <iostream>
        #include <cstdlib>
        #include <string.h>
        #include <vector>

        using namespace std;

        int main()
        {
           
        long long int n=0,m=0,k=0,soln=0;



            cin
        >> n >> m >> k;

            vector
        <long long int> v;

           
        for(int i=0;i<n;i++){
                v
        .push_back(0);
           
        }

           

           
        for(int i =0 ; i < m;i++){
               
        long long int a=0,b=0,c=0;
                cin
        >> a >> b >> c;
               
                v
        [a-1]+=c;
               
        long long int f=0;
               
        for(int j=a;j<b;j++){
                    f
        ++;
                    v
        [j]=v[j]+c+f;

               
        }  

           
        }
           
        for(int i=1;i<=k;i++){
               
        long long int t;
                cin
        >> t;
                soln
        = soln+v[t-1];
           
        }

            cout
        << soln << endl;
        }


        ...this got accepted....


        I concluded that memset was giving garbage..I dont knw why..!!....
        • 13 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          long long int *v; 
          sizeof(v) is equal to size of pointer to long long int
          you need write memset(v,0,sizeof(v[0]) * n); 
          instead of
          memset(v,0,sizeof(v)); 
13 years ago, # |
  Vote: I like it +18 Vote: I do not like it
The problem statement for B is maybe a little bit hard to understand. It took several minutes for me to completely catch what the problem asked. I think it should've been worded better.
  • 13 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    Problem B statement not just little bit hard,it was too hard to understand.
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Right. The English version was really troublesome and confusing. I don't know about the russian version but if it was not that the problem was make difficult to understand, then the problem-setters should be more careful.
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      The Russian version seemed hard to understand to me as well. I probably spent more time reading the statement rather than coding the solution.
    • 13 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it
      Don't worry, the russian version was complicated too =) I read it three times before understood something...