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

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

Hello Codeforces community !

I am glad to announce Codeforces Round 307 (Div. 2) on 12th of June at 19:30 MSK. Authors of this contest are Nikola Mandic (nikola12345) and Aleksa Plavsic (allllekssssa). This is our first round and we really tried to make interesting and solvable problems. Traditionally Div.1 participants can take part out of the competition ( personally I believe that the problems are worth to Div 1 participants, and nobody can solve everything in 20 minutes ). This is the first Serbian round and we want to invite our friends from Serbia to take part in this round and maybe prepare some of next rounds.

The main character of this round is gonna be GukiZ ( our proffesor of computer science ). He really helps us to become better people and developers !

We want to thank Zlobober for help in preparing contest and great advices, Delinur for translating problems statements into Russian and MikeMirzayanov for fantastic Codeforces and Polygon platform !

We wish you great fun, a lot of Successful hacks, Accepted solutions and high rating !

UPD: Scoring distribution: 500 — 1250 — 1750 — 2000 — 2500.

UPD2: Due to technical reasons round was delayed by 10 minutes. Stay tuned!

UPD3: +5 minutes. Thanks for your patience!

UPD4: System testing is complete, but the rating update won't be that fast since we are working on improving our cheater catching system. Thanks for your understanding!

Congratulations to winners!

DIV 1:
1.MrDindows

2.kennethsnow

3.ecnerwala

4.I_love_Tanya_Romanova

5.Hasan0540

DIV 2:
1.hrzhrz_hrzhrz

2.slo

3.wangjing

4.cyber_tourist

5.Moose_Lee

Thanks to all participants. We hope you have a good time and learn something new.

UPD5: Link of editorial !

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

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

Okay, let's be finally realistic here: This time I will either jump into Div.1, or I will not.

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

I wish good luck to all participants.;)

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

It clashes with Codechef Snackdown is it possible to shift it ?.

http://snackdown.codechef.com/schedule

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

i might not be red but i can host a contest and i will do it .... best of luck

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

It looks like we will have harder division 2 contest than usual. Hopefully it will be not too hard ;)

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

Congratulations on your first round! Zelim sve najbolje

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

( personally I believe that the problems are worth to Div 1 participants, and nobody can solve everything in 20 minutes ) May I shout out tourist and run away?

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

Really look forward for this contest! allllekssssa helped me a lot to understand problem's editorial with his solution (back when I used to only know Pascal).

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

First Serbian round! Congratulations setters. :)

One day, we'll have an Indian round too. And I'm looking forward to that day with excitement. Hope it comes soon.

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

Thanks guys ! I hope that we will justify expectations !

We have solutions in Pascal and after contest we will put it in Editorial.

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

Challenge for tourist: Solve all problems in 20 mins

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

If the problems are so hard, how do you expect div 2 participants to enjoy the round?

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

I hope that the problems will be on different topics ...

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

"a lot of Successful hacks" :/ I guess this line is not pleasant for me. every-time I saw it on the round announcement, one of my sol got hacked just before the contest end. and when I try to hack someone else's sol I fail.

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

Auto comment: topic has been updated by allllekssssa (previous revision, new revision, compare).

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

"( personally I believe that the problems are worth to Div 1 participants, and nobody can solve everything in 20 minutes )"

it appears that problem statements will be lengthy and (especially) problems A and B will be implementation problems with lot of cases and variables to handle, that may make these problems, easy but time taking problems.

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

the earliest scoring distribution ever .

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

Hi, this is the first time I will participate out of competition. I want to know if my rating will be affected.

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

I'm surprised by the scoring! It seems that we're gonna have a harder B than usual... :)

Good Luck

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

I want to get out of the green zone towards blue and purple .

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

will, I wish to get accepted as possible because I got enough of digging in the newbie area ..

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

    Once I was also deep in newbie, but through regular practice I have managed to participate 5-6 times in Div — 1 (candidate master). One day you will also enter Div — 1 by learning DS and algo, regular practice and by making, "up-solving", your habit.

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

Seen 5000+ (and still counting) registrants for the first time in Div 2 only contest.

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

And its delayed....

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

The best option : Switch back to Snackdown... :)

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

Damn I hate Delays

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

~800 unrated participants :3

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

Great. People, we have yet another delay (+5min this time) :(

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

In Russian, please.

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

Good luck have fun.

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

What The Fuck happened?? why these delays??

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

Soon contest announcements will have "due to technical reasons, round will actually start on time. Thank you for your understanding!"

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

Really this last delay?

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

heeyy , you are not codechef

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

10 + 5 + 2.5 + ... it's gonna be 20 mins...

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

It's 1:41 a.m. here in Korea.. Delay means less sleep to me T_T

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

00100011 00100110 00010000 00010011 00010011 00010000 00100100 00100011

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

4859 rated contest registration !!! I this its a new record For Div — 2 :D

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

Are you sure it's for DIV 2 ???

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

Remove problem A, and it becomes Div1 Only

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

    B was probably too easy for Div1 too, but others are ok.

    Spent last 70 minutes on D, almost come to the solution, but lacks of knowledge in combinatorics. Also can't get how to do fast 2^(bignumber) mod 10^9+7.

    I've came up to formula: 2^(n * total_bits — 2 * (bits1pos1 + bits1posn) — 3 * (bits1pos2 + ... bits1posn-1)) for each combination of bits1pos1 ... bits1posn-1 where thier sum = amount of bits with value 1 in K.

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

This contest was too easy

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

Thank you for this great round! (no sarcasm here) I've never thought that Div2 rounds may be that tough ;)

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

Both announcements were so obvious and useless.

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

How can we solve problem C??

was it a DP?

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

What could be pretest 12 for B?

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

I have solved 2 problems A and B :))))

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

These cases with L=0&M=1 for D which are not included in pretests... Pure cruelty :)

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

What's behing B's pretest 12 ?

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

How to solve D?

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

.

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

Very disapointed because of lags on the site at the end of the contest. Was not able to submit my D problem in time because of too long response of site.

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

the contest ended before time i couldn't submit in last 5 mins constantly got cf is unavailable :(

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

On this contest I've intentionally solved A in C++ and D in Java to get the achievement "Polyglot" on this site (there was a blog post about it). Now my only hope to get it is to have A && D passed systests :)

UPD NOOOOOO, my D solution has failed system tests :(

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

Nice Round :)

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

Worst contest in CF history.

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

Test cases of Problem B are fun to read. For eg.

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

I have totally misunderstood B, I was searching for maximum length of concatenated substrings instead of maximum number of substrings and besides that I have passed 12 pretests :D

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

Сдал Ешку (претесты) sqrt-декомпозицей, потом кое-что поменял и переотправил. Переотправленное решение получило TL. После контеста отправил предпоследнее решение и получил ACCEPTED. :(

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

I hate this contest because this contest Ever not Normal and very hard ):

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

P.S. Три раза пытался сделать нормальный размер изображения — не вышло.

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

which data structure needs to E?

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

Why O(|a| * 26) solutions on problem B gets TL54?

UPD.Answer here

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

What a shit contest , fucking aweful :) allllekssssa dont creat contests anymore

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

It was quiet contest for Div.2 participants.

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

Задача D сводится к задаче "Сколько существует различных строк длины N, состоящих из символов «0» и/или «1», в которых две единицы не идут подряд?". Эту задачу я хорошо знаю и даже разбирал её на хабре (задача 8).

Ответ на задачу про строки, не содержащие "11" — это число Фибоначчи от n+2. А общее число таких строк — 2 в степени n. Вычитанием получаем число строк, содержащих "11". Если в очередном бите k стоит 1, то в массиве в соответствующих битах должны идти две единицы подряд — то есть умножаем на первое число. Иначе умножаем на второе число.

Число Фибоначчи можно сделать за log(N). http://habrahabr.ru/post/148336/ Разумеется, все операции по модулю n. Быстрое возведение в степень тоже можно делать по модулю n. Дальше всё понятно.

Решение: 11558240. Код чисел Фибоначчи взят с хабры, все операции по модулю m. К сожалению, на контесте забыл проверить, что если m == 1, то ответ 0.

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

    Я долго думал насчет нормальной формулы, но ничего в голову не пришло, зато родилась другая идея. Будем пересчитывать ответ для n через ответ для n / 2. Пусть наша функция возвращает массив ans, ans[i][j] — количество таких комбинаций из нулей и единиц, при которых не встречаются две подряд идущих единицы, начинающихся на i и заканчивающихся на j (0 <= i, j <= 1). Тогда можно пересчитывать ответ за О(1), отдельно разобрав случаи четного и нечетного n (при четном мы просто совмещаем две одинаковых блока, при нечетном вставляем между ними еще цифру). Ответ — сумма всех значений ans[i][j]. Мое решение.

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

Prob C : Is this a valid test case 4 1 2 3 0 0 Ans : 8 If so should be a good hack !

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

Rating should be given too much late. Follow topcoder's Rating system.

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

Thanks to authors for good problemset!

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

    It's good only for div1 not div2.Bcoz it was rated only for div2 and most of the contestant don't solve problem more than 1. problem A and problem B are huge difference.

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

      So, do you want to stay in Div2 forever? You should be able to solve problems like this to get higher in ranks, imo. And this contest was the one, where speed was really important, for example if you managed to solve A only. The problems were quite nice, looking forward for such challenging round further on.

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

Thanks for the nice problems. Best Div-2 only contest in a while.

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

Can somebody help me out here? My submission 11555558 for B gives MLE.I have no idea why.I use O(|a|) memory according to me.

And now problemset wouldn't open to check.

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

I think problem statement's are shit!!

What is the approach for B ??

I tried to find as many of string b as possible and then as many string c, and i tried c then b and printed the one with max non-overlaping substr and didn't work.

this is my code

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

    I did the same and it passed. Ok I am joking,it didnt :). I am really curious to explain us a better programmer the reason.

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

    Brute force solution: try all possible counts of b and calculate count for c. Find the case with max sum of counts for b and c.

    11550107

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

    Did exactly the same. I believe there might be a case that fails it, but I couldn't come up with it during the contest, so submitted, and got wa on #12.

    It's a very long pre-test, so it's hard to see where your solution goes wrong, I hope the author can explain why this approach fails. ( or someone else).

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

    Binary search:

    Let N be a number of non-overlapping substrings in string a, that are equal to b or c. We want to maximize this number.

    Here is the main idea


    lo = 0 // the answer should be at least 0 hi = a.length()+1 // the answer can't be larger than a.length() while (hi - lo > 1) N = (hi + lo) / 2 doesThisNWork = false for each numberOfStringBinA = 0 ... N let numberOfStringCinA = N - numberOfStringBinA good = true for each character ch = 'a' ... 'z' if ( (number of ch in string a) < numberOfStringBinA * (number of ch in string b) + numberOfStringCinA * (number of ch in string c) ) good = false if good // we found a way to make numberOfStringBinA b's and // numberOfStringCinA c's in string a. doesThisNWork = true if doesThisNWork lo = N else hi = N
  • »
    »
    11 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Ya I did the same But it will not contain all the case example aaaaaabbbbbb aab abb If you go by your approach then the answer would be B: 3 & C: 0 then C: 3 & B:0 which will both give you 3 as final answer whereas the final answer would be 4 B:2 C:2 So you have to take cases like this in consideration

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

Auto comment: topic has been updated by allllekssssa (previous revision, new revision, compare).

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

most rating will be decided by how fast we solve problem A

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

If you have TL54 in B, check int values.You should use long long. Maybe you have such lines with mistake:

 for(int i = 0; i <= sz(a); i++){
    bool ok = true;
    for(int j = 0; j < 26; j++)
      if(tmp[j] - i * usedB[j] >= 0)
        tmp[j] -= i * usedB[j];

You have i <= 1e5 and usedB[j] <=1e5. i * usedB[j] <= 1e10.

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

very nice problems . tanks lot!

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

Can anyone tell me why my code was too slow for problem B? http://mirror.codeforces.com/contest/551/submission/11556052

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

First time reading C, D, E...

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

What is the expected complexity for problem E? Tell me it's better that ...!

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

For the problem B i used this idea:

Let a,b,c the input strings
Let x the amount of only strings b in a.
ans = 0
Now we can:
iterate for i=[0..x] 
   substract i strings from a. 
   let j = the amount of string c in the remain string. 
   if (i+j) > ans
       //save results
print ans;

I think this is the same that 
A >= i*(B)+j*(C)
where A,B,C are column vectors (from string a,b,c)

(sorry if it was incorrect. I am not good in maths) and we want the maximum value of: (i+j) How solve this math problem? thanks in advance

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

This is my first time using C++ in a contest, and I'm having the following issue.

The code for problem D runs correctly on my machine, but when I do the custom invocation, the answer always returns 0.

Any ideas why? Thanks.

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

Auto comment: topic has been updated by allllekssssa (previous revision, new revision, compare).

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится
Thanks to all participants. We hope you have a good time and learn something new.

Yes,those who are complaining dont want to learn anything and just want good ratings and easy problems

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

Obviously this contest was harder than usual. Specially B seemed to suit for C and C for D. Whatever, still great contest due to the beauty of the problems.

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

This contest was great! Many thanks to the authors.

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

Congratulations to the real winners!

Real Div.2 winners:

  1. slo

  2. sheep

  3. AICoderMike

  4. unkoman

  5. please_delete_account

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

Just noticed the dreamoon_love_AA test case in B. hahaha

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

There are more funny tests. Like this:


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

Admins ,

I just wanted to say one thing that all these people who participate in their first contests and get into top 5 or top 10 must be banned ! These discourages others who are working to get in top 5 because of these genius div1 players who make fake profiles to just see where they stand in div 2 . For instance in this contest 4 out of top 5 players are those who are playing in their first match and now voila these geniuses are in top 5 :/

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

    Should Petr or ACMonster or vepifanov or rowdark or dreamoon_love_AA be banned? Codeforces isn't the only Online Judge in the world.People can practice in other Online Judges and then particpate in CF.

    UPD:In case of misunderstanding,I didn't say multi accounts shouldn't be banned(and I think unrated Div.2 winners in this round is from Div.1).All I say is banning all unrated Div.2 winners is not a good way to prevent multi accounts,I think.

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

It was a good contest.but I don't know why my B was not accepted. :\ :D good luck!

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

    As per previous comments above, your code won't pass the following test case:

    Input: aaaaaabbbbbb aba bab Output: abaabababbab

    It assumes that the maximum answer will occur when string b is taken out fully before string c, but the maximum can occur for 'interior' solutions where b and c are not fully removed.

    Fix: Find max number of times b can be removed, then iterate through removing 1 to max b's (and any remaining c's per case) and find the instance with largest sum of b and c removed.

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

I have no idea why this submission gets runtime error on codeforces but runs fine on my local ide and codechef. http://mirror.codeforces.com/contest/551/submission/12304739. Please check.