anup.kalbalia's blog

By anup.kalbalia, 12 years ago, In English

CodeChef invites you to participate in the May 2012 CookOff at http://www.codechef.com/COOK22

Time: 2130 hrs 20th May 2012 to 0000 hrs, 21th May 2012 (Indian Standard Time — +5:30 GMT) — Check your timezone.
Details: http://www.codechef.com/COOK22/
Registration: Just need to have a CodeChef user id to participate. New users please register here
Problem Setter: Vitaliy Gerasymiw.
Problem Tester: Антон Лунёв (Anton_Lunyov)

It promises to deliver on an interesting set of algorithmic problems with something for all.
The contest is open for all and those, who are interested, are requested to have a CodeChef userid, in order to participate.

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

| Write comment?
»
12 years ago, # |
  Vote: I like it +21 Vote: I do not like it

Just a gentle reminder. The contest starts in 10 minutes.

»
12 years ago, # |
  Vote: I like it +24 Vote: I do not like it

Is site down only for me?

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    No. For me — too.

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      There was a syn attack on our servers. It has been resolved now. We deeply regret the inconvenience caused.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    No, it is almost unavailable for 5 or 10 minutes already.

    Also, the problem statement of the problem which had "etc." instead of input and output format got updated.

»
12 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Can anyone publish the statement of some problem other than "LUCKYBAL" and "LUCKYSTR" here?

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    A Little Elephant from the Zoo of Lviv likes lucky strings, i.e., the strings that consist only of the lucky digits 4 and 7. The Little Elephant calls some string T of the length M balanced if there exists at least one integer X (1 ≤ X ≤ M) such that the number of digits 4 in the substring T[1, X — 1] is equal to the number of digits 7 in the substring T[X, M]. For example, the string S = 7477447 is balanced since S[1, 4] = 7477 has 1 digit 4 and S[5, 7] = 447 has 1 digit 7. On the other hand, one can verify that the string S = 7 is not balanced. The Little Elephant has the string S of the length N. He wants to know the number of such pairs of integers (L; R) that 1 ≤ L ≤ R ≤ N and the substring S[L, R] is balanced. Help him to find this number. Notes. Let S be some lucky string. Then |S| denotes the length of the string S; S[i] (1 ≤ i ≤ |S|) denotes the ith character of S (the numeration of characters starts from 1); S[L, R] (1 ≤ L ≤ R ≤ |S|) denotes the string with the following sequence of characters: S[L], S[L + 1], ..., S[R], and is called a substring of S. For L > R we mean by S[L, R] an empty string. Input

    The first line of the input file contains a single integer T, the number of test cases. Each of the following T lines contains one string, the string S for the corresponding test case. The input file does not contain any whitespaces. Output

    For each test case output a single line containing the answer for this test case. Constraints

    1 ≤ T ≤ 10 1 ≤ |S| ≤ 100000 S consists only of the lucky digits 4 and 7. Example

    Input: 4 47 74 477 4747477

    Output: 2 2 3 23

    Explanation

    In the first test case balance substrings are S[1, 1] = 4 and S[1, 2] = 47. In the second test case balance substrings are S[2, 2] = 4 and S[1, 2] = 74. Unfortunately, we can't provide you with the explanations of the third and the fourth test cases. You should figure it out by yourself. Please, don't ask about this in comments. Date: 2012-03-01 Time limit: 2s Source limit: 50000

»
12 years ago, # |
  Vote: I like it +22 Vote: I do not like it

Why on earth the statement of "Common" problem changed into smth completely different right in the middle of the contest?

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

    I've already written solution for first version of this problem and then saw that it became another:)

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

    It was a mistake on our side. We resolved it and made an announcement. We are sorry for this.

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      I guess it would be better to create a pop-up window with announcement, like codeforces does.

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

    Unfortunately such problems with codechef are known. You should check announcements regularly.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    I didn't read it because its name suspiciously didn't start with "Little Elephant and " :)