Блог пользователя darkshadows

Автор darkshadows, 12 лет назад, По-английски

CodeChef invites you to participate in the September Mega Cook-off 2014 at http://www.codechef.com/COOK50. This is the Mega Warm-up Contest for ACM ICPC Regionals (India). The top 100 Indian Students shall have their ACM-ICPC expenses reimbursed. Find the details here.



Time: 21st September 2014 (2130 hrs) to 22nd September 2014 (0000 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.

Details: http://www.codechef.com/COOK50/

Registration: Just need to have a CodeChef user id to participate.

New users please register here

- Problem Setter : Lalit Kundu
- Problem Tester: Tasnim Imran Sunny
- Russian Translator : Sergey Kulik
- Editorialist: Devendra Agarwal
- Mandarin Translator: Gedi Zheng & Minako Kojima

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.

  • Проголосовать: нравится
  • +16
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

"The top 100 Indian Students" : Suppose I get a rank of 101 among Indians and some people among the top 100 Indians are not university students then would I be considered among the "The top 100 Indian Students" ?

»
12 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +15 Проголосовать: не нравится

Contest starting soon, let's brace ourselves for 404s :D

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Quite nice problem, I think the hardest problem is a bit easy, but it is still interesting. Some students from my school successfully persuaded me to participate in such a Sunday midnight =)

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

How was SUBLCM supposed to be solved?

  • »
    »
    12 лет назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    There is a n * log(n) solution.

    1. A subarray from i to j is considered valid if non of two elements from it share the same prime divisor. In other words every two elements of the subarray are co-prime.

    2. Notice that a[i] <= 10^6. So we can easily get all the prime divisors for each 1 <= x <= 10^6. This can be done in n * log(n). Then we can use these precalculated arrays of divisors.

    3. We have two pointers identifying the borders of subarray candidate. We also have a set of all prime divisors of the elements in current subarray.

    4. We move right border. If all the prime divisors of the right-most element are absent in the set then new subarray is valid, add all new prime divisors to the set. If the set has any of prime divisors of the right-most element, then we move left border excluding prime divisors of the left-most element from the set. We move the left border until we eventually can add the right-most element.

    5. Each time the right-most elements is added we receive a valid subarray. Its length is answer candidate.

    Here is my code for this solution.

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hmm, I'm getting TLE in the hardest problem. The funny thing is, it runs in 3 seconds on the maximum random case and its runtime is pretty much fixed at O(20·(N + M)), so it probably fails because of the testing machine being slower than mine...

»
12 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +16 Проголосовать: не нравится

Test cases for SUBGCD are very weak. This solution passed — but it fails on following test:

3
2 6 3
»
12 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Did anybody manage to solve WW2 without matrix exponentiation?