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

Автор Swistakk, история, 9 лет назад, По-английски

I see that in 2,5 hours there is a fun SRM, so I thought I would let you know cause I learned that coincidentally and I see no blog about it (but expect it to be probably significantly easier than Div 1 :( ). If I did everything correctly, here is its time: https://www.timeanddate.com/worldclock/fixedtime.html?msg=Fun+SRM+%28Pittsburgh%29&iso=20170908T19&ah=1&am=35 P.S. clist.by shows this: https://www.timeanddate.com/worldclock/fixedtime.html?msg=TCO17%20Pittsburgh%20Event%20/%20Fun%20SRM&iso=20170908T1700&ah=6&am=0 which is 2 hours earlier, but Arena's schedule says what is in first link...

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

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

This is the second time in row I find there is an SRM by complete luck. (Thanks to you this time).

Any idea why isn't topcoder or cgy4ever letting us know about them? Why don't they send emails and why just making it in general so hard to track their rounds..

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

What does "Fun" SRM mean? Is it not a rated match?

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

I think regional rounds/fun SRMs should not be rated for Div1 users :P

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

How to solve 1000?

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

Can someone give me a small hint on the 600? I see DP solutions but don't get the main idea.
Edit: only if it its difficulty is like Div. 2 600, not if it's like a Div. 1 600 (no point in me practicing that level). Thanks!

The 250 was like Div. 2 level nowadays. So here's a one-statement solution for it.
Just For Fun, since this is the Fun SRM (tm)

string isMatch(string S, string T, int p = 0) {
	return S[p] ? S[p]==T[p] || 1-string("0oo01ll1mnnm").find(S.substr(p,1)+T[p])%2 ? 
               isMatch(S, T, p+1) : "Impossible" : "Possible";
}
  • »
    »
    9 лет назад, скрыть # ^ |
    Rev. 6  
    Проголосовать: нравится +1 Проголосовать: не нравится

    To me it's a Div1 250 or maybe hard Div2 500 if that answers your question.

    Now for the solution:

    Trivial Solution that will TLE: Just do a regular backtracking with a vector, and keep all numbers you took, to add a number, just iterate on the vector, and make sure no 3 numbers would be divisible by 9.

    How to improve it:

    Notice that since we care about divisibility it's the same as taking every number modulo 9.

    Now for each class from 0 to 8, do you ever want to keep more than two numbers of this type ? The answer is no, since any future number you choose must be the third, it's enough to keep for each modulo from 0 to 8, if you have 0,1 or 2 frequency of that class.

    You can mask the frequencies by using a ternary mask. ( Like you use a normal mask, but instead treat it as in base 3, so you have 0,1,2 for each bit), or you can use two binary masks.

    Then let dp[i][msk] represent the maximum number in the sets you can keep while being at index i, and having mask msk. Solution is max(dp[n][m]) for all valid masks m.

    Complexity is n*(3^9)*9.