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

Привет.

В 19.08.2018 16:35 (Московское время), состоится общий рейтинговый раунд Codeforces Round #505. Этот раунд идет в паре с раундом #504.

Часть задач взята с Финала VK Cup 2018 (ashmelev, Errichto, Lewin), часть придумана мной. Спасибо моим товарищам — Диме (cdkrot), который, кстати, является координатором этого раунда, Коле (KAN), который позвал меня его проводить, а также Грише (vintage_Vlad_Makeev) и Ильдару (300iq) за то, что они просто клевые.

Также спасибо Майку MikeMirzayanov за множественные баг-фиксы и замечательный Codeforces!

Задач будет семь со следующей разбалловкой:
500 — 1000 — 1500 — 1750 — 2250 — 2750 — 3500

UPD. Систесты окончены. Разбор

Поздравляем победителей!

  1. Swistakk
  2. DearMargaret
  3. Kostroma
  4. Benq
  5. AwD
  6. xumingkuan
  7. webmaster
  8. TLE
  9. Egor
  10. kriii

Так же, как и в прошлом раунде, по инициативе компании ВКонтакте будут разыграны очки GP30.

Участники сортируются по очкам за оба тура (если участник не участвовал в одном из туров, очки, набранные за него, полагаются равными нулю); при равенстве очков как тай-брейк используется максимальное за оба тура время, прошедшее от начала тура до последней посылки, прошедшей претесты.

Напоминаю, что лучшие 10 по сумме очков GP30 получат фирменного плюшевого персика.

Надеюсь, что вам понравится. Удачи!

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

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

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

palindromic round :D

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

имя раунд

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

Ok so greengrape, another shitty maths contest.

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

How many problems, duration, scoring?

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

some strong pretests please GreenGrape :D

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

Happy Hacking&&High Rating

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

I feel like it will eventually become like this..

*Fine, I found that CF#505 really seems to be the most sad for me as the pic....

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

How many problems and what will the scoring be like?

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

I think I know who is the author of problem B from the official final round...

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

Please contest don't have problems that solve with a lot of IF and ELSE! (Iranian people say this problems "Kharkari's problems")

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

I think the last few games are very difficult.

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

I think the problems will be very interesting.

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

.

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

three contest in a row......interesting

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

Can codeforces hold more contest in a row??? I need more!!! I don't need sleep!!!

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

can someone please provide a test case where this solution will fail http://codeforces.me/contest/1023/submission/41825727

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

"Some problems are taken from VK Cup 2018 Finals" is that mean that some problems are already known to some contestants??

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

    No.

    At least, in the VK Cup series, no contestants today know about those problems (as those who do know has participated before in the official round).

    For other series (like parallel Olympiad or something), disciplines are kept through words. Not a really effective way in theory, but it's worked times before.

    For example in the announcements of Codeforces Round #500 (based on EJOI — European Junior Olympiad in Informatics):

    We kindly ask all the community members that are going to participate in the competition to show sportsmanship by not trying to cheat in any manner, in particular, by trying to figure out problem statements from the onsite participants. If you end up knowing some of the problems of EJOI (by participating in it, from some of the onsite contestants or in any other way), please do not participate in the round. We also ask onsite contestants to not discuss problems in public. Failure to comply with any of the rules above may result in a disqualification.

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

Will it be harder than 504 or not?

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

Are the editorials going to appear?.. (for this and the previous rounds)

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

Mike Mirzayanov slaps codeforces roof

  • this boy can hold so many contests without crashing
»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I wish to turn blue!

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

Hope I will become expert after this round

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

Я так понял, что примеры из условий — это и есть все претесты.

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

    Совет — если хочешь зашутить в комментах, чтобы твою шутку оценили и при этом в посте есть англ перевод, пиши на англ

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

U want strong pretests? Hehe. Hehehehehe. AHAHAHHAHAHAHAHHAHAHAH!

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

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

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

Pretty nervous having sense of getting WA on systest D. :o

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

How to solve D? I couldn't get my DP to be faster than n^3

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

i began to feel like stupid. How did so many ppl solved D ?

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

what was pretest 6 for problem B?

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

Как решать D?

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

How to solve problem B?

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

How to solve B and C?

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

Me while coding div2C:

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

Can somebody explain how to solve problem D? Is it requires DP or something else?

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

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

What is the hack for Problem B? Got hacked continuously XD

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

Me vs. problem C

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

how to solve C?

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

    My assumption was that it doesn't make sense to do more than one time the operation. Hence, check the length of the pattern from beginning as l1 and length of pattern from end as l2 such that s[0] and s[n-1] are not equal then answer will be max(answer without any operation, l1+l2)

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

      It can be proved actually. Just try rotating it in your head. Find the longest zebra prefix and the longest zebra suffix. Rotate the string the way these two zebras will be together but make the left rotating part as small as you can (that means, the left part is zebra prefix itself). Beginning of the new max zebra prefix will be the end of the old zebra prefix rotated and the new sufix will be a substring that went AFTER the old max zebra prefix (also rotated). So there is no way first and last symbols would be different in a new string because in that case (substring that went AFTER the old max zebra prefix) substring will be the part of the old prefix. Hope you understood something.

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

    split it in max len correct zebras. mark from 1 to n. whenever you split it between any two zebras, the neighbours stay the same, except for the first and last zebras — the could become neighbours so the answer is either the longest correct zebra or the sum of 1st and last zebra if it's possible

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

Pretests of D are very weak.

Even checking that any tree can be made from the input (not essentially BST) with every 2 adjacent nodes having GCD > 1 passes pretests.

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

1114 passed pretest on D. I would bet a lot even at 1/10 odds that no more than 650 will pass full tests — or at least close to that ammount.

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

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

Is ans for C just max for all cyclic shifts?

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

My idea for problem E:

Find m cells such that they aren't an end point, and move the cubes to them.

Next, move the cubes from this cells to their end points.

Am I missing something???

Link to my submission, I had two bugs in it, But am just saying about the idea :\ [submission:http://codeforces.me/contest/1025/submission/41865118]

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

This was the worst contest I've ever participated in.

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

In C, is "w" or "b" or "bbb" has a length of 1? but I think that one color can not make a zebra. A real zebra should have at least two alternating color,one color can not make a zebra.so the answer should be at least 2. Can someone explain this?

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

anyone used articulation bridge to solve D like me?

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

How to solve F?

Also, to anyone who solved D by dp[l][r] means whether it is possible to build a BST using number from position l to position r

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

    F is similar to the JOI problem: solution

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

    Think of every pair of non-intersecting triangles (they have points a[0], a[1], a[2] and b[0], b[1], b[2]).

    Now note that there are only two lines passing through points a[x] and b[y] for each 0 <= x, y < 3, such that all the points of one triangle will lie to the left of the line (one point will line on the line), and all the points of the other triangle lie to the right of the line (one point will lie on the line).

    How can we solve the problem? We can draw a line from point p[i] to point p[j] for each pair of points. Points p[i] and p[j] become vertices of different triangles. Now we should find the rest of the points of our triangles. For the first triangle, we choose any two points to left of the line, for the second triangle, we choose any two points to the right of the line.

    The statement above helps us to understand that, using this algorithm, we add each valid pair of triangles exactly two times.

    Now we should find a way to find the number of points to the left of each line. First, sort all the lines by their angle. Suppose we now consider the line l[i] = A[i]*x + B[i]*y + C[i]. Denote pp(i, j) = A[i]*p[j].x + B[i]*p[j].y + C. For each line l[i], we should keep the points sorted by its pp(i, j) (p[a] must be earlier than p[b] if pp(i, a) < pp(i, b). If we can maintain this, we can say number of points which are to the left of l[i]: it's all the points p[j] which have pp(i, j) < 0. Don't forget that the points are sorted by pp(i, j), so, to answer this, we can find the position of first point pp(i, j) >= 0 using binary search and so we find the answer.

    Now we should learn to maintain the array of points in the sorted order when we move to another line. Notice that, when line changes, only some two points swap (those two that lied on this line). It's possible beacuse the lines are sorted by angle.

    So, we get O(N^2 * logN) solution.

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

I have to say, for a 1000-point-level, B today was quite insane.

Hmm, or B, C and even D are all insane, in terms of both ideas and corner cases?

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

These are the worst pretests ever.

The pretests don't test logic, or time limit, or anything. What was the point of them even being there? Might as well make it TopCoder style with blind AC after submission.

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

typical contest from GreenGrape

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

that moment when u realize the pretests on D are the samples and ur solution is wrong

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

Hack for D : 5 2 3 5 7 210 Answer : NO

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

Is there any way to cause TLE when hacking? I saw several solutions for B that could have been hacked by using highly composite numbers. I generated a case using the following code:

int n = 150000;
cout << n << endl;
REP(i, n) cout << "72072000 58378320" << endl;

Which I believe would have caught some solutions in my room for TLE, but the file was too large. The case had to have n ~ 13000 to fit the input limit, which wouldn't cause TLE. Is there any way around this?

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

Whose idea was to put a problem like E into the contest? Worst problem I've seen in a while. I wish I'd just have spent my time hacking. I think my idea works but debugging this would be just crazy. 41865146.

  1. Move every cube to a unique y-coordinate (n*n moves)
  2. Move every cube to the correct column (n*n moves)
  3. At least one column is empty or this is trivial (n*n) moves (and step 4 doesn't happen)
  4. Using the empty one, solve its left side, then solve its right side (2*n*(n+1) moves)
»
8 лет назад, скрыть # |
 
Проголосовать: нравится +171 Проголосовать: не нравится

F*** your pretests again.

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

Well, back to pupil again...But...What can div2B pretest 6 look like?

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

What was the mapping of problems from VK Cup to problem from #504 and #505?

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

Тупые претесты как же я вас блин ненавижу

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

Constaints in D were pretty weird. n<=700 and first promising solution that comes to mind is lightweight n^3. I coded it, but got TL, which is reasonable if TL=1s, n=700 (inb4, precomputed gcd of course). So I switched to bitsets and did this successfully with time of execution 109ms. But it seems many people passed it with simple n^3. What is the reason for such weird choice of constraints and TL?

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

Was this the WEAKEST pretests in Codeforces history!!!

Now looking at my solution for problem C, I can't believe it how it passed them !!!

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

I have a simple and short solution about pB
let ans = gcd(a[1]*b[1],a[2]*b[2],.....,a[n]*b[n])
if ans != 1 then you can greedy to find the answer by the code below

	for(int i = 0; i < n ; i++){
		if(__gcd(ans,a[i]) == 1){
			ans = __gcd(ans,b[i]);
		}else {
			ans = __gcd(ans,a[i]);
		}
	}
  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +3 Проголосовать: не нравится

    Are you sure this is optimal? For example, what if a[i], b[i] were both valid options and it was optimal to choose b[i] but you instead choose a[i]. Or is there never a case where at the start ans > 1 but becomes 1 during the process.

    Because this was my idea when reading the problem (woke up too late to participate) but I had a slight worry that you can hit ans = 1 at some point in the process so there would be more to the problem than just checking choosing the valid one (because both might be valid).

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

      SorryQQ I don’t understandthis the sentence “what if a[i], b[i] were both valid options and it was optimal to choose b[i] but you instead choose a[i].”
      While you are choosing the answer , it’s impossible that both gcd(ans,a[1]) gcd(ans,b[1] equal 1 because ans is a[i]*b[i]’s divisor.

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

        Sentence doesn't make sense because it was under the assumption you could reach 1.

        Also I am still unsure how that proves you never hit 1. (I saw another comment mentioning proof by induction, but no one elaborated)

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

      The initial gcd calculated gives us a value which divides either a[i] or b[i] for every i, and so does all of the factors of that gcd, therefore, we know that in the above code, atleast one of gcd(ans,a[i]) or gcd(ans,b[i]) will be greater than one.

      Once you reach a prime number in the above loop, you can be sure that it divides atleast one of a[i] or b[i], which means it the final answer will stay that prime number only.

      Hope that cleared up your doubt!

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

Holy sh**, the weakest pretests I've ever seen. Goodbye rating, I'll miss you

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

Weak pretests for B.

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

big fat L

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

These are the contests when you feel grateful for Hacks.

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

System test failed !!!

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

GreenGrape and weak pretests ,still better love story than twilight .

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

Waiting for a standard 5 problem contest

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

Hackforces as usual :(

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

if pretests were sample tests they would be stronger than this pretests

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

F*** your pretests!

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

GreenGrape, what's pretest 14 on problem E? My solution seems to pass my validator for all random tests.

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

Downvoting the blog right away for the pathetic pretests.

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

Good problems(except C) but terrible pretests !

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

    Doesn't problem C has a nice solution? (Just double the string and find the longest alternating substring that has length shorter than n?)

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

      Why do we double the string? I feel like it should be something obvious but cannot parse the meaning from looking at code submissions.

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

      It's not a bad problem. The solution is really nice!! But for me, I solved it by just guessing that doing more than 1 operation might not help increasing the answer. I was unable to prove it during the contest time, but still got AC. I think few participants like me also did the same thing.

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

    I felt like C was a "Lucky" problem. For some it was a lucky and for rest not so. When I was seeing a lot of people were getting AC, I just did the double string approach but I have no proof.

    D was a good problem. But N <= 700 was not a good constraint. I think I could have solved it quicker if it N <= 500. I had to check carefully whether it will pass. And then having no other way, I just did the n^3 dp and it got accepted.

    Problem B was nice. I liked the solution.

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

no feedback contest

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

But Is It Rated?

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

YYYYYYAAAAASSSSSSSS!!!!!!!!!!!

I can stop whining about my growing record of second places :>>>>>>>>> Waited for this so long, so happy :D

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

Congrats to Swistakk for finally winning something!

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

Downvoted. Thanks for the weak pretests which made my solutions for both B and C failed system test.

May I call this FSTforces?

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

system testing is a massacre for us noobs

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

Contrary to the opinion which seems to prevail in the comments so far, I quite like it when the pretests and the system tests are not of the same effect. It gives more value to local testing, which is definitely a useful skill on contests outside Codeforces.

So, just wanted to chime in with it, otherwise the discussion looked pretty one-sided.

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

    I think that it should've been announced before the contest, not after it during the full tests. I believe that programming contest site is not a place for such surprises.

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

    I can understand disliking the system or being disappointed that your solution fails.

    But one thing that really bothers me is the attitude that it is somehow the authors' fault if your solution fails system tests. It's still your faulty code. Please accept that.

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

      Well said.

      Related, from personal experience: once I transferred from the mindset like "my programs are awesome and so CAN'T fail" to the more realistic "my programs are still awesome but WILL have bugs", soon enough, my programs had less bugs. Still nowhere near zero though.

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

      If the purpose of pretests is to act like the real tests, but to reduce the load on the servers during the contest, then technically every time a submission fails to system tests it is the author's fault.

      Of course if your solution fails, it's your fault for writing buggy / incorrect code, but why does that discredit saying that the pretests being weak are a problem?

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

        If the purpose of pretests is to act like the real tests, but to reduce the load on the servers during the contest, ...

        Alright, it's the first time I see it formulated like this. So, unlikely that this is what the platform authors envisioned.

        Or maybe I just didn't follow.

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

          The purpose of pretests is to make the most unreasonable solutions fail.

          Quoting this blog from MikeMirzayanov

          And now comes the time when you solved the problem and submitted it. It will be checked only on preliminary testset (also we call such tests "pretests"). It is known that pretests do not check solution completely. Usually there are 2-10 pretests, and the fact that the solution passed pretests says only that it is quite reasonable. Typically pretests not contain the maximal tests, corner cases, etc.

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

            Most importantly:

            Typically pretests not contain the maximal tests, corner cases, etc.

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

            I think nowadays on Codeforces pretests are supposed to contain at least tests with maximum size of input, maximal value of n, etc. However the coverage of corner cases does vary a lot.

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

            8 years ago

            I think the idea of pretests was distorted (sorry for my english), so these tests have changed into a reduced variant of systests. The fact that your solution can be tested precisely during the contest seems casual but common and, in my view, more practically-oriented. Anyway, contesters got used to it, so all these protests and downvotes things can be understood. 3 of my 4 solutions failed on systests, so I as a submit-see-green-proceed person was upset and could understand them.

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

    Then what's the point of pretests? It's pretty unfair if some special cases are covered in pretests and some are not. Should the pretests just cover the samples?

    Also, if pretests are weak, the hacking system is incredibly broken: How much you score becomes very dependent on the room you are in (how many people had easy bugs to find), The score you get highly depends on whether you get hacked or not, since getting hacked saves you from failing to systests, and, say two people in the same room find some corner case, now they are competing in speed at noticing that someone submitted to a problem, and hacking that person.

    Of course you write a brute-tester when programming in the real world, but even if the pretests are very weak, it is not necessarily correct to write one. You just have to make the decision to risk failing to system tests, or wasting time writing a brutetester. I find it much better that you don't have to guess whether your solution has a bug or not before writing a brutetester. With strong pretests, you still have to find what the problem in your code is, which I think is the main part of debugging anyways (not finding out that a bug exists in your code).

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

      Conversely, if passing the pretests should always mean passing the systests, then what is the point of systests?

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

      OK, not arguing your points for now, but asking a question instead.

      What, in your opinion, would be the best difference between pretests and system tests? Your comment sounds much like you'd want them to act the same. Well, we have plenty of other contest platforms which have exactly that: no pretests.

      For a platform where pretests and system tests are two distinct entities, it makes perfect sense that they have observably distinct effects.

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

        Topcoder has very nice hacking system. All pretests are open, so you can see for yourself, how strong they are. Almost every contest a lot of solutions get hacked or fail systests, but noone complains that pretests are weak.

        On Codeforces, you have no idea how strong pretests are, which often feels frustrating.

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

          On TopCoder, people also complain when pretests are weak :) .

          And yeah, the pretests system on Codeforces is far from perfect because of its quirks with uncertainty. Hey, if there was no uncertainty, there won't be vastly different expectations for pretests, and there won't be this thread!

          Still, it is possible to utilize the imperfect system, and it is possible to effectively shut down the pretests-and-hacking part of the contest. Both happen, in different rounds. I just like the former option better, is all: we have plenty other platforms for the latter.

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

If I hypothetically (but not really) found a test case that breaks my solution (and possibly other people's solutions) to a problem, even though it passed system testing, am I obligated to release that test case? (Or maybe a better question is do I want to.)

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

Wrote a script to determine the prize winners (sorry for the ugly code): link

  1. Benq (score = 110)
  2. TLE (score = 107)
  3. ko_osaga (score = 100)
  4. Swistakk (score = 100)
  5. Egor (score = 79)
  6. DearMargaret (score = 75)
  7. ksun48 (score = 60)
  8. Kostroma (score = 60)
  9. natsugiri (score = 45)
  10. AwD (score = 45)

I am 11th in this list :(

UPD: System testing is over, nothing changed.

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

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

why cf predictor is not showing anything ?

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

Could someone tell me the reason why changing '&' with '&&' between two booleans give TLE. Solution with '&'

Solution with '&&'

»
8 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +23 Проголосовать: не нравится
  • Solved: 4 out of 7 ->Solved: 3 out of 7 -> Solved: 2 out of 7 ->Solved: 1 out of 7 (no reverse)
»
8 лет назад, скрыть # |
 
Проголосовать: нравится +99 Проголосовать: не нравится

The announcement has failed system test too.

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

codeforces need to organize more combined contests(div1+div2). bcoz i think solving more not easy problems with stronger participants let us to rise faster

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

How to solve D ?

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

It seems that a number of submissions with time complexity O(d(a1, b1)·n) passed problem B, where d(a1, b1) denotes the number of divisors of at least one of a1 and b1.

However, there are only tests with large d(a1) (number of divisors of a1) and d(b1), but not large d(a1, b1): there may be many duplicate divisors of a1 and b1. For example, 1396755360 and 1102701600 are integers having the most divisors (1536 and 1440) below 2·109, but there are only 2208 different divisors of at least one of them.

I generated a pair of integers for a1 and b1 below 2·109 with the most d(a1, b1): 1889727840 and 1715313600. They have totally 2760 different divisors. I think it would be better to add something like the following case to the practice version of the problem:

150000
1889727840 1715313600
1889727840 1715313600
1889727840 1715313600
...
1889727840 1715313600
1889727840 1715313600
1999999973 1999999943
  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +26 Проголосовать: не нравится

    Out of curiosity, how did you generate these numbers? I couldn't figure out a way to do it that would run in a reasonable time and I also couldn't find the numbers online.

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

      I searched the prime factors p = 2, 3, 5, 7, 11, ..., and multiplied them to a1 and b1, that is, multiply a1 by p0, p1, p2, ... and multiply b1 by p0, p1, p2, ... each time. Of course we do not want to waste a small prime and use a big prime, so we should avoid multiplying p0 to both a1 and b1.

      It seems kind of brute force searching with some pruning, but it runs only 72 seconds on my computer. I couldn't analyze its accurate complexity. (x, y denote a1, b1, and xrem, yrem denote 2·109 / a1, 2·109 / b1 in the following code)

      Code

      I think it can even be a nice (and hard) problem in some round (given n, find a1 and b1 below n with max d(a1, b1)) if someone figures out some optimizations to make it run in several seconds :)

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

    Added, thank you.

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

    Thanks God this test was not in original system tests! My solution 41848942 got accepted in 1185 ms but now it gets TLE on the test #99.

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

    My code still passed this test in practice in 1465ms.
    Link

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

We love you so much, GreenGrape... Wish you are already preparing next contest.

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

When I click on Editorial, it says "You are not allowed to view the requested page". Please fix it. Edit: Fixed.

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

Is it rated ? Cause i don't see anywhere about rated or unrated announcement.

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

can someone please help me in debugging my code. I've no idea why it failed on test 45.

code link. My dp state is dp[i][j] -> if the root is ith index vertex and we have to assign tree upto jth index (actually I skip a dimension. instead of having l, r I have single j as we know if j is less than current root then (l, r) == (j, i-1) else (l, r) == (i+1, j)).

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

I see that this contest was received kinda badly as this blog post has -27 votes. It seems that only thing people complain about are weak pretests. There were no other issues (ok, maybe I can add dubious constraints for D), problems were fine, statements were clear, no CF hardware issues lowering overall experience etc. I think that these downvotes are way too harsh

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

    With all due respect, I doubt if you'd feel so if you lost your rank 1 because of some systest-failed B or C or D.

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

    the thing that was too clear, was the fact that authors didn't spend time on making strong pretests, bc that was not a thing that they can not do it. also i have a bad feeling about all rating changes, some wrong solutions that get accepted (on the first contest's D), but i believe that for first contest's A, even though the pretest were weak, every participant could take the tricky test cases from the problem statement itself (it means it was written good) i couldn't take part in second contest (even though i liked to), so i can't say anything about it. at the end, i believe contest weren't very bad, but our expectations were so high (Why, our expectations so high — eminem )

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

      "the fact that authors didn't spend time on making strong pretests"

      disagree. It's just author want participant get FST XD.

      pretest is always a trap, that's why we calls it pretest : )

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

        its ok to catch some solutions in that trap, but half of them??? i don't know

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

    Because pretest is an issue that causes tons of lower level contestants to fail things that they would otherwise have passed. And it is more significant than bad statements.

    Hardware issues are not the domain of authors.

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

    Maybe these downvotes are due to some bots? As happened on Announcement page of Round 502.

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

Any one else thinks random pretests are stronger??

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

when you considering : " come on, codeforces super fast and I get PP with 120ms "

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

If you guys knew that the pretests were going to be weak because of the author or whatever, why didn't you just take the extra 5-10 minutes to do local testing/try to prove your solution is correct?

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

In such contests, I indeed feel very fortunate that I got my C hacked during contest, and then I got a chance to get it accepted :)

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

End of the coding weekend! Thank you Mike and CF.

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

In prob D, I approached it with DP with the parameters left, right and root

So, I guessed the Time complexity will be about O(N^3) but when i made a random test case of 700 it took so long

Then I changed the DP table, and I got MLE...

http://codeforces.me/contest/1025/submission/41864181

Can anyone tell me where I am wrong?? And, what is the right sol?

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

Pretests too weak, Hackforces?

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

These submissions are identical, but my solution got tle in system testing :(.

http://codeforces.me/contest/1025/submission/41880498

http://codeforces.me/contest/1025/submission/41858978

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

In 1025B - Ослабленный Общий Делитель

I have a solution and got Accepted but I find a test case can hack the solution:

Solution:41885803

Test case:

3
6 6
2 2
3 3

Expected -1 but this solution got 3. Hacked myself :-)

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

Your text to link here... Why is this B right?

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

GreenGrape My solution 41866649 was accepted .But i hacked it .

5
6 9 10 49 70

It should be output "YES". But my solution output "NO".

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

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

why this solution can ac http://codeforces.me/contest/1025/submission/41902787 but this will tle http://codeforces.me/contest/1025/submission/41905132 only change "dfs(l,i-1,i)&&dfs(i+1,r,i) " to " dfs(i+1,r,i)&&dfs(l,i-1,i) "

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

Hi Everyone. Tried to write down A and B's solution. Here's the link. Editorial for A & B

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

I was looking at the fastest solutions to the problem D and found this one — 41869905. What the heck is this?

    if (n == 4 || n == 5 || n == 7)
    {
        cout << "No";
        re 0;
    }

It seems like the author of this solution just explored the tests where his solution is failing and added a simple heuristic. Indeed, it seems like there're no tests with n = 4 and the answer "Yes" which is sad.

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

When do we get the editorials?