Комментарии
На pakhomoveeCodeforces Round #893 (Div. 2), 3 года назад
+4

Not anymore :|

На awooEducational Codeforces Round 150 Editorial, 3 года назад
0

Your complexity is too high man, your code is O(n^2) but it should be O(n) , you should not check if it "is_beautiful" for every addition.
check what i have tried:
https://mirror.codeforces.com/contest/1841/submission/209460248 : similar to what have you done and it exceeds the time limit of course.
https://mirror.codeforces.com/contest/1841/submission/209466517 : (ignore check function) this is the solution in O(n)

На VladosiyaCodeforces Round #874 (Div. 3) Разбор, 3 года назад
0

:/ not anymore