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

Автор Anadi, 8 лет назад, перевод, По-русски

Я рад пригласить вас принять участие в рейтинговом Codeforces Round 519 by Botan Investments. Дата и время раунда: 28.10.2018 18:35 (Московское время).

Этот раунд будет совмещенный для обоих дивизионов и будет содержать 7 задач на 2 часа, раунд будет рейтинговым.

Задачи были подготовлены Anadi, Grzmot, isaf27 и Rzepa. Также спасибо:

KAN и cdkrot за помощь в подготовке задач; --Pavel--, Nerevar, map, GR1n, rutsh, AlexFetisov и winger за тестирование раунда; MikeMirzayanov за платформы Codeforces и Polygon.

Раунд проходит при поддержке фонда Botan Investments.

Призы! Лучшие 50 участников и 20 случайных участников, занявших место с 51 по 500, получат персональную толстовку с хендлом Codeforces.

Фонд Botan Investments занимается инвестициями в стартапы на ранней стадии помимо поддержки курсов и соревнований по спортивному программированию и машинному обучению. Один из стартапов имеет офис в Сочи и занимается проектами, связанными с Computer Vision и Augmented Reality. При разработке приходится эффективно решать задачи, нерешенные никем ранее. Опыт решения олимпиадных задач очень помогает и в нашей команде разработки ядра технологии более половины людей с богатым олимпиадным прошлым: --Pavel--, Nerevar, map, Babanin_Ivan, GR1n, rutsh, mekagem

Сейчас есть отличная возможность присоединиться к команде и поучаствовать в создании и развитии уникальных технологий. В недавнем прошлом фонд Виктора Шабурова инвестировал в Looksery, который в 2015 году присоединился к Snapchat за $150M.

Разбалловка будет анонсирована позже. Желаю вам повышения рейтинга и надеюсь увидеть вас в таблице результатов!

UPD: I'll be on the community Discord server shortly after the contest to discuss the problems.

UPD: Scoring: 500 1000 1500 2000 2250 2750 3500

UPD: Editorial

The round is over, congratulations to the winners!

  1. scott_wu
  2. mnbvmar
  3. HIR180
  4. ksun48
  5. Benq
  6. geniucos
  7. Alex_2oo8
  8. Petr
  9. Um_nik
  10. V--o_o--V
  • Проголосовать: нравится
  • +544
  • Проголосовать: не нравится

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

Clashes with El Clasico:(

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

Wow, top 500 will have the opportunity to receive personalized hoodie with CF handle. Hope to receive it. Good luck.

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

Mr Anadi what will you do during contest? watching your favorite team match or answer participants questions ???!

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

"Prizes! Top 50 participants and 20 random participants with rank from 51 to 500 will receive personalized hoodie with CF handle." -- That's awesome, I wish to get under 500.

Ah! But i still struggle with Div 2 C :(

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

Wish a hoodie be with you (and me) :D

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

why can't I register for the contest? it says I must have a rating between 9 and 9,999
UPD: it's fixed now !!

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

I'm glad to invite you to take part in Codeforces Round 519. Actually it will be two separate rounds "Codeforces Round #519 (Div. 1 Only)" and "Codeforces Round #519 (Div. 2 Only)". The division problemsets will share many problems, but not all of them will be the same. So, Div. 1 users should register on "Codeforces Round #519 (Div. 1 Only)" while Div. 2 users should register on "Codeforces Round #519 (Div. 2 Only)".

This is what is written in the invitation mail I received.

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

Awesome idea for giving hoodie to random guys, chance for non-red guys get a hoodie.

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

Could we get a picture of what the hoodies look like (for extra motivation)?

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

I like these random gifts, as usually all of the prizes only go to the same top users.

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

unfortunately , The contest will be at the same time as the Clasico match .

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

What do the hoodies look like?

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

Anadi, are you Indian?

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

It's a great pity that I cannot join in the match because I have to get up early tmorrow.

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

Look at my registration date. Do you see it too?

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

Good Luck on contest!

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

Is there any way to buy these hoodies ?

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

I don't understand why make it today and in same time with big football game that many people want to watch ?

It is not a round with onsite contest in same time, it is a normal round that can be delayed or shifted one day, there are many people here includes me that want to watch the game and take part in the contest why we can't do both ?

I think it is not late to delay it to tomorrow or just today after the game

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

try a try, ac is ok. Fighting!

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

I have never been so confused. Can't decide whether to give contest or watch El Classico.

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

The random winners will be determined with these two scripts:

Where seed is the number of points of the winner of the next contest, length is 450 (500 - 50) and nwinners is 20.

randgen.cpp
get_ranklist.py
»
7 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -83 Проголосовать: не нравится

Please shift the round by 1.5 hrs. El classico comes only twice every year. Please I beg you! cdkrot Anadi

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

Expect problem statements to be short in size. Wishing everyone high ratings. :)

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

First time participating in a contest. Hope to solve atleast one

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

https://prnt.sc/lbfg9c В письме ошибка...

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

Score distribution?

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

which one is more important elclasico or contest? ;)

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

Lol, dotorya_.

dotorya is the last person you should've done this with though.

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

To those football fans competing in this round, I am not saying that you are making a wrong decision, but unfortunately it seems like you have just missed an epic El Clasico match :'(

But well, I am probably missing my chance for hoodie as well, so yeah.

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

Barca 5 — 1 Real :))

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

>those names in A

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

How to solve F?

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

how to solve c ?

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

    Have a variable cur = array[0]. Loop from 1 to n-1. if(cur == a and array[k] = b and array[k+1] == a), then you should swap at k and set cur to b. If cur == b and array[k] == a and array[k+1] == b, then you should swap at k and set cur to a. If you finish and cur == b, then you should swap at n-1.

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

    You can always rearrange the string to make every 'a' stands before all 'b's.

    To do this, we will traverse through the string and find substrings (consisting of consecutive characters) that all characters of it are 'a'. Let's denote the substring S[L, R].

    It's easy to say we will reverse prefix L - 1 (if it exists) and prefix R.

    Total complexity is O(N) with two-pointers. Naive solution in O(N2) is still acceptable with the given constraints.

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 4  
    Проголосовать: нравится +5 Проголосовать: не нравится

    With regexes. To substitute all a+ or b+ (but not b+ (longest) at the ending of the string) by '0' * length_of_a_match + '1' — Perl code: 45056981. Or, Algo_Rhythm's variant with regexes: 45058519

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

Am I the only one who didn't read The string s consists only of characters 'a' and 'b'. in problem C, and solved it for general strings?

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

    I've noticed it just now by reading this comment. I was blown away when I saw so many people solved C so fast. Damn!

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

    I did the same :( Btw, how can it be solved for general strings?

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

      Our operations are equivalent to appending each character in order to either the beginning or end of the string. In the lexicographically smallest string, we want to put all a's into the beginning of the string. This means that after the first 'a', we put everything but a's into the end. Before the first 'a', we want to put nothing but b's to the beginning of the string, and so on.

      So Greedy still works, you just check if the current letter is smaller than or equal to all previous letters. If it is, add it to the beginning, otherwise add it to the end.

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

        Could you describe more in terms of reverting or not reverting a prefix. For example for string bazab how would you iterate over this string and make greedy decisions?

        If we iterate from last to first char in the string, once we find a we want to reverse the prefix baza and it also means that we want to maximize prefix baz. And to maximize prefix baz we want to reverse it and minimize prefix ba, so we want to reverse ba too.

        Would it work if we store char[] maxOnPrefix and char[] minOnPrefix to make decisions greedy?

        During contest I solved this problem for generic string with dp.

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

    Bruh me too xD

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

How to do E? I don't see how you can do it faster than O(n^2)

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

Does somebody know pretest 3 for C or pretest 7 for D?

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

Why everyone solved D....So,how to solve it?

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

    Split the first permutation into largest substrings which appear in all other m - 1 permutations:

    1|2 3|4
    2 3|4|1
    4|1|2 3
    1|2 3|4

    If the length of the i'th substring is k[i], then the answer is:

    long long ans = 0;
    for (int i= 0; i < numberOfSubstrings; i++)
      ans += k[i] * (k[i] + 1) / 2;
    
  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    Just finished my code 2 minutes after the contest. I used rolling hash and binary search. For each number i from 1 to n,find the longest subset obtainable starting with the value i. Complexity O(NMlogN). CMIIW.

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

    My personal ideas: The numbers from 1 to N can be seen as a directed graph, and I'll count the appearance of the pair (i, j), with i and j are the values of 2 consecutive elements on one permutation.

    If any pair appears exactly m times, then there will be an edge starting from u to v.

    With this given, it's certain that the graph will be a DAG, and there is no vertex having more than one edges pointing at it.

    So we can do a simple DFS from all sources to find the answer. With each source, if the total number of traversable vertices from it is x, add x * (x + 1) / 2 to the answer.

    UPD: I didn't take the TL seriously and my solution got TLE. Damn!

    Total complexity is O(NM * log(NM) + N).

    UPD2: Accepted solution (904ms): 45022094

    UPD3: Improved solution (171ms) from suggestion of mouse_wireless — complexity reduced to O(NM): 45031805

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

    Oh well, I guess my solution was kinda different...

    Create the array ans[] where ans[x] is the amount of ways which start with number x in all permutations. Also, make the array pos[][] where pos[x][k] is the index where number k appears in permutation x. In particular, for num[m][n] (where num[x][y] is the yth number in permutation x), ans[num[m][n]] = 1. Now for any i with n-1 >= i >= 1 (a for loop where i decreases from n-1 to 1), take next = num[m][i+1]. Then, if for some j (1 <= j < m) num[j][pos[j][num[m][i]]+1] != next, we will have ans[num[m][i]] = 1. Otherwise, ans[num[m][i]] = ans[next]+1. Indeed, we know the value of ans[next], since we loop through i in decreasing order.

    Therefore, the answer for the problem is the sum of ans[x] for all x with 1 <= x <= n.

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

How to solve E? My idea was to do some sort of complementary counting but not sure how to get the sum for every team for person i in a fast way. Maybe there was some other observation?

Also how did everyone solve D. I used hashing+binary search, and I thought it was weird so maybe someone has a better solution.

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

Can someone point out why my code for D is getting TLE for testcase 9 ? I guess it's O(mn) which shouldn't give TLE. I maybe wrong though.

The main idea is simple: Consider a directed graph with n vertices, with an edge from i to j iff the numbers i, j are adjacent in all m permution. Note that for any vertex, ,and which vertex (if any) v is connected to can be checked in O(m), so for all vertex doing this takes O(mn). Now the answer is where ci ranges over the sum of connected components.

Code for D

Could've implemented E easily had I not spend more than one hour implementing+debugging this :/ (got the idea for E within a few minutes)

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

Is E solved using the fact that min(a+b) = (a+b-abs(a-b))/2?

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

How to solve F??

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

The problems were nice and interesting. But maybe the set together was easy.

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

What is the hack for B?

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

It says pending systests, but systests have already started?

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

As wise man said, please stop creating problems.

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

I hope strong cases for F.

Nice tasks :)

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

Was the last problem created by the authors, by coordinators (KAN, cdkrot) or by 300iq? :)

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

https://mirror.codeforces.com/contest/1043/submission/45019500 Any idea why this got a TLE? It's o(nmlogn) if I'm not mistaken. Could someone check it and let me know? Thanks!

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

How much cases do you have for model solution of G?

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

That 700 lines for G from tourist...

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

why wrong answer in test case 2 is considered as a penalty in problem B. Link to the solution in which wrong answer in pretest 2 is considered penalty :

Your text to link here...

Please take a look into it

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

When easy problems are attached with unnecessarily long question sentences, it is only an English reading comprehension contest for those who are not English speakers.

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

Great contest , nice questions, nice tests, and I actually understood questions with reading only one time:)

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

Contest featuring most advanced algorithms to date:

(A) Binary Search (B) for loop (C) for loop (D) Binary Search (E) Binary Search

"Balanced contest"

I actually liked the adhoc nature of the contest though

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

    It seems you use binary search where it is not necessary =) I have 0 BS's in solutions of this contest.

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

      Thank you for your insight. I have updated the topics.

      Updated list:

      (A) loop (B) loop (C) loop (D) loop (E) loop

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

        According to your classification, 95% of the problems will have "for loops" topic :)

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
         
        Проголосовать: нравится -32 Проголосовать: не нравится

        It would be ok to see such comment from somebody, who solved all these problems in about a hour. From you it seems like one more comment of type <I want contribution!>.

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

          <I want contribution!>.

          What you think about anything I post is your own business. But why is it not ok to post what I want to say? I don't meet a rating threshold?

          And by the way, if you really are going to set such requirements for others at least meet them yourselves.

          • »
            »
            »
            »
            »
            »
            7 лет назад, скрыть # ^ |
             
            Проголосовать: нравится -13 Проголосовать: не нравится

            You can post anything that you want to say. As I also can. As we both do. And no, I try not to judge people by their rating, rather by their words (as in your case too).

            I set such requirements because you said (implicitly) that problems were easy and (explicitly) that contest was badly balanced. Maybe it was really easier than average CF round, but it should be said by somebody, who really feels that problems were easy (for 2 hours, of course). I didn't say it and you did. That's why you should meet such requirements and I shouldn't.

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

              Sorry if I seemed like I was insulting the round. I actually like the round because it focused more on thinking than algorithm.

              I never meant to say round was easy, just that problems could be solved without advanced algorithms and more thinking.

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

man why was I soooo sloooooow solving C

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

A notorious coincidence

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

how to get a random hoodie?

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

I misread problem C and did not know that there are just two letters. Does my code really solve it for general ? my code

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

i think this contest rating changes can change top rated user in CF. i think mnbvmar will be top rated user after rating changes !!!!!

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

Why is time limit for D so tight? Some NlogN solutions have passed and some didn't. I don't know if it wasn't the expected complexity.
Update: My two solutions for D: TLE and Accepted. Both are O(NMlogN), just a one line difference (cin.tie(0);).

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

Who (outside of top 50) gets hoodies?

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

My solution for F (45014411) failed in contest with tle 35:(. But it later passed all 4 times I submitted it in practice just after adding "srand(chrono::steady_clock::now().time_since_epoch().count());". 45021752. It is basically removing duplicates and then removing multiples of numbers and then kind of bruteforce with pruning. Can this solution be hacked and testcases are weak or can it be proved that it will work with high probability?

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

    It seems like you are not using Mersenne Twister in your first solution, relying only on default random function without setting seed (which makes it totally predictable).

    So, for any fixed n your shuffle is just a fixed permutation, which could be inverted. Then hacker could just take a test where bruteforce is working too slow and apply inverted permutation to it. In that case after random_shuffle you will get that bad test.

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

      Thats ok. But even with true randomness should such solution work?

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
        Rev. 3  
        Проголосовать: нравится +19 Проголосовать: не нравится

        Well, seems like not.

        Suppose we have a number 299 999 and every number from 150 002 to 300 000 which is divisible by 2 — n = 75001. The answer is clearly 2 (gcd(299 999, 300 000) = 1), but you can get it only with 299 999. Note that no numbers would be deleted as duplicates or multiples.

        Let k be the position of 299 999 in shuffled array. You will need to do at least k*(k-1)/2 operations to get there (because your map stores every number you processed so far if ans >= 3, and until position k ans = 12), and if k is big enough, this number is too big.

        I runned your code on test above locally, and it took several minutes to finish (depending on position of 299 999 in shuffled array).

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

          Thank you! It makes me feel better that my solution didn't pass during the contest:D

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

            There is another trick which allows you to reduce the number of candidates even more: You don't need to keep two numbers which have the same set of prime divisors. So if you have 2*2*3 and 2*3*3 keeping just one number is enough. This will reduce the number of candidates to 14548 in the provided test case.

            I used this during contest and my solution passed in 280ms. See 45018592 for details.

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

I think I would have TLE on my own problem D solution with test:

100000 10

1 2 ... 100000

1 2 ... 100000

...

1 2 ... 100000

100000 99999 ... 1

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

This is not to blame the judges, but kind of disappointed that this submission 45015775 of mine for problem E failed the time limits. I did not think the I/O would be so slow for the problem. This would probably pass within 2.1s or less I guess. Please consider setting a little more kind time limit for problems where solutions with worse complexity has no chance of passing the test.

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

    just add 2 lines in your template and forget about slow IO

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

    No one to blame but yourself. You used fast IO in D because you were afraid of 10^6. You didn't use fast IO in E while it was almost the same input size, 12 * 10^5 but with larger numbers so input/output is even larger.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится -10 Проголосовать: не нравится

    I also think problem E had too much I/O for the time limit. I usually like to use python to solve problems, and with some trickery it is mostly possible to solve any problem on cf with python (using pypy). However this problem had so much I/O that I was not able to do the I/O in under 2 s. Had to resort to C++ to get my solution to pass.

    I really think the constraints should be made such that not only C++ is able to pass. Currently this problem was mostly testing how quick I could get the I/O, which is not what makes these competitions fun.

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

Messi got injured in this round.

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

I think problem setters need to re-consider limit for python. I have one implementation code of problem D, correct algorithm. However, I got different verdicts from different compilers: — http://mirror.codeforces.com/contest/1043/submission/45023038http://mirror.codeforces.com/contest/1043/submission/45021411

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

Забавное условие у задачи B, вечеринка в честь массива))

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

Sadly,this contest changed the world rankings !

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

What's with test case 36 on D. I see tourist got TLE on it, and many of my friends also did. Why did this happen?

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

I want to specially thank the problemsetter that came up with problem F. One of the most beautiful problems I've seen lately.

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

tourist getting TL 45001078 on D during contest with C++11, but AC 45024674 post-contest with the same code submitted with C++14. feelsbadman

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

Polish writers need to "polish" their problem setting skills!!

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

Good contest, it’s a pity that I didn’t have time to write (it coincided with conducting XXVI team championship of pupils of St. Petersburg in programming)

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

Объясните пожалуйста кто-нибудь условие задачи С, я так и не понял что значит развернуть префикс. 1й пример: входные данные: bbab выходные данные: 0 1 1 0

Можно последовательно, что меняется в строке если в выходных данных единица первая, вторая и третья?

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

    Значит "вырезать" из строки префикс, перевернуть и вставить в начало. Пример: строка "bbbaababbbab", мы хотим развернуть префикс длины 8. "Вырезаем" его ("bbbaabab"), переворачиваем ("babaabbb") и вставляем вместо исходного, получая строку "babaabbbbbab".

    Разворачивается префикс длины 1, т.е. "b", получается строка "bbab". Потом разворачивается префикс длины 2, т.е. "bb", получается строка "bbab". Наконец, разворачивается префикс длины 3, т.е. "bba", и получается строка "abbb".

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

when will random winners announce ??

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

Those who got hoodies, share the picture of it. I really want to see how it looks.

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

Are there any contests available this week?

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

are there any contests available this week?

NOIP is coming..

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

So who won the random hoodies?

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

I understand you are not supposed to look a gift horse in the mouth. But does the hoodie really need a gigantic Che Guevara picture? What does it have to do with Botan Investments, Codeforces or programming in general?