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

Автор Ormlis, история, 3 года назад, По-русски

Всем привет!

В воскресенье состоится всероссийская олимпиада школьников для 5-8 классов имени Келдыша. Удачи всем участникам! Олимпиаду подготовила Московская методическая комиссия, известная вам также по Открытой олимпиаде школьников по программированию, Московской олимпиаде школьников по программированию, Московской командной олимпиаде и олимпиаде Мегаполисов (раунды 327, 342, 345, 376, 401, 433, 441, 466, 469, 507, 516, 541, 545, 567, 583, 594, 622, 626, 657, 680, 704, 707, 727, 751, 775, 802, 829, 852, 857).

Мы рады представить Codeforces Round 879 (Div. 2) на основе задач олимпиады. Это будет Div. 2 раунд, который состоится в Jun/18/2023 11:05 (Moscow time). Обратите внимание на нестандартное время начала раунда. Вам будет предложено 6 задач и 2 часа на их решение.

В связи с этим мы просим всех участников сообщества, участвующих в соревновании, проявить уважение к себе и другим участникам соревнования и не пытаться читерить никоим образом, в частности, выясняя задачи у участников соревнования. Если вы узнали какие-либо из задач олимпиады имени Келдыша (участвуя в ней лично, от кого-то из участников или каким-либо иным образом), пожалуйста, не пишите раунд. Участников олимпиады мы просим воздержаться от публичного обсуждения задач. Любое нарушение правил выше будет являться поводом для дисквалификации.

Задачи соревнования были придуманы и подготовлены grphil, Mangooste, sevlll777, Siberian, TeaTime, teraqqq, Ziware, TheEvilBird, Ormlis, Alexdat2000, vaaven, Mikhango, Artyom123 под руководством Ormlis, grphil и Андреевой Елены Владимировны.

Спасибо Artyom123 за координацию раунда, а так же MikeMirzayanov за системы codeforces и polygon, который использовался при подготовке задач этой олимпиады.

Большое спасибо тестерам раунда: PurpleCrayon, He_Ren, feecIe6418, penguinhacker, ix35, Dominater069, MagicalFlower, tzc_wk, gyh20, ezraft, Kieray, AquaMoon, satori_____, njupt_lyy, Mike4235, competitive__programmer, EternalJourney, Ritwin, xiaossr, turmax, fastmath, Kapt, Kirill22, Be_dos, king-pankevich.acoolguy, gmusya, turist, vsinitsynav, orz, TheGoodest, playerr17, lesssia.

UPD1: Разбалловка:

500 — 1000 — 1250 — 1750 — 2500 — 3000

Всем удачи!

UPD2: Editorial

UPD3: Победители!

Официальные:

  1. Final_Brave_Niuniu
  2. solar_tree
  3. lovemeifyoucan
  4. do_while_not_not_true
  5. Cherrt

Неофициальные:

  1. hank55663
  2. stkwill
  3. jiangly
  4. Sugar_fan
  5. Brovko
  • Проголосовать: нравится
  • +463
  • Проголосовать: не нравится

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

Hoping this time, the contest to be balanced with better pretests, unlike the previous few editions :)

All the best everyone!

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

Sorry if this is a stupid question but what does it mean that the round is based on the russian olympiad? I read something like that on codeforces sometimes, also in other posts. Can somebody explain?

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

Good luck everyone! wish I turn purple!

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

When will scoring distribution come out?

edit: got it.

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

I hope the round will be better than the previous one and I will become a master!

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

Can you make the pretests stronger?

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

Will this be rated?

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

Two contests in one day, cool!

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

I'm confused why comments like "Good luck" sometimes get downvotes but sometimes get upvotes

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

I hope this contest is going to be better than previous contests. I kindly ask authors and testers to balance the pretests of problems, as it effects to the contestant's performance

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

two rounds in one day??

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

confused..which one to attend , 879 or 880

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

is it ununsual to have 2 rounds happening so close to each other? never in the Codeforces have i ever seen this coming

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

Super Sunday tomorrow! CF 879 > ARC 162 > CF 880

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

I have a question. How manage Codeforces rating changes if I participate in both rounds? My new rating will be calculated using my rating before compete in the first round or after my first contest rating changes? I ask that because I wanna do both contest :).

»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится
This Sunday will take place All-Russian olympiad for students of 5-8 grades, in the name of Keldysh

Who is Keldysh?

+

It's great to see AquaMoon as tester

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

Be ready with Math Problems :)

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

Russian kids eat div.2 problems for lunch ( ̄︶ ̄)↗ 

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

I hope there's no DDOS,I just have a bad ABC.

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

I was wrong :3

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

Is this round rated?

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

I submitted D two times out of FST paranoia and the second time I submitted my code I lost about 100 points. Is this intended? I thought only the first accepted was the one that counted.

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

Bob's goal is to maximize the duration of the game

Sure, Bob, whatcha gonna do about it?

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

Nice contest. First time to solve only A & D.

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

I submitted my code for D 2 times out of FST paranoia and approximately lost 100 points on the second submission. Is this intended? I thought that only the first accepted counted for scoring.

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

    This is how it is intended to be, it's not a bug. In Div.1 or Div.2, if you submit multiple times with "pretests passed" to a single problem, only the last submission will count and all previous ones will be regarded the same as previous incorrect submissions.

    In other words, you get -50 for each previous submission, and you get time penalty according to the last "pretests passed" submission. I actually don't know if submitting a "wrong answer" submission after "pretests passed" gives any penalty, though.

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

Problem E is so nice. The answer cannot exceed $$$max(a_{i})+n^2$$$, so $$$ans \leq 10^{10}$$$. Now imagine function $$$nxt(i, x)$$$ which tells you the smallest index $$$j \gt i$$$ such that $$$a[j] \nmid x$$$. Then, to find MEX, we can just use the $$$nxt(i, x)$$$ atmost $$$log_2(max(a_{i})+n^2)$$$ starting from each $$$i$$$!

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

    Was being braindead sorry.

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

    There are $$$O(n)$$$ prime numbers in range $$$[1,n \cdot logn]$$$. So you can consider your upper bound of answer to be around $$$n \cdot logn$$$.

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

    We can show that the answer doesn't exceed $$$10^7$$$.

    Consider the subarrays $$$[i;i], [i;i+1], \dots, [i;n]$$$ (i.e. subarrays with a fixed left point) and their LCM's. If we go through these in order from left to right, the next segment's LCM must be a multiple of the previous one. This means that if the value changes, it must at least double. This means that within these segments starting at $$$i$$$, there can only be $$$\left\lceil\log_2 10^7\right\rceil = 24$$$ different values $$$\le 10^7$$$. This means that within all subarrays over all leftpoints $$$i$$$, there can be at most $$$n \cdot \left\lceil\log_2 10^7\right\rceil = 3 \cdot 10^5 \cdot 24 = 7.2 \cdot 10^6$$$ distinct values $$$\le 10^7$$$. Since this number is less than $$$10^7$$$, some values $$$\le 10^7$$$ must be missing, and the answer is thus $$$\le 10^7$$$.

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

Can someone explain problems D and E to me? I solved problem ABC quickly, but I couldn't solve any of the others.

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

Any hints for solving problem C ?

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

Could you please put a link to the contest in the announcement?

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

Anyone else so dumb that they confused statement of B like this:

Find a number X in [L, R] such that the strength of X and R is maximum. I wasted an hour just to realize the correct statement, and then it was just a matter of a couple of minutes.

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

Amazing Contest! Can anyone tell the difficulty rating of A,B,C please? Also how to solve D?

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

    The difficulties probably are 800,1000,1200

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

    For D, my main observation is that we can always get the answer by choosing two segments and calling all the numbers in the larger one. This will give us a maximum difference of $$$2$$$ times the length of the larger segment minus $$$2$$$ times the intersection length. Now if we can come up with a way to choose the best segment to pair a given segment with, we can iterate over all segments and take the maximum answer we get.

    what I did was to keep track of the shortest leftmost segment, shortest rightmost segment, and the shortest segment overall. Let those be $$$[l_l, r_l], [l_r, r_r]$$$ and $$$[l_s, r_s]$$$ respectively. Now for each other segment, if $$$l_i \gt r_l$$$ or $$$r_i \lt l_r$$$, we choose this segment and that boundary segment which doesn't intersect it. If the current segment intersects both boundary segments, we have 3 choices:

    • We consider the current segment and the left boundary

    • We consider the current segment and the right boundary

    • We consider the current segment and the shortest segment overall

    We can simply check what we get for all these choices and update the answer as we go. Finally, we have to check what answer we can get if we choose the right and left boundary segments themselves.

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

    For problem D, a naive solution is to iterate over all pairs of students, then try to raise the first one's hand as high as possible and the second's hand as low as possible. Using greedy algorithm can easily determine the best strategy to ask the topics and update the answer. The time complexity is $$$O(n^2)$$$.

    A key observation is: let i, j, k be the students with the smallest r, the one with the biggest l and the one with the smallest r-l, respectively. We can make the second student be either i, j or k, which can be proved right with simple caseworks.

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

problem D is nice!

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

problem B

accepted code give output 29 for this input.( 88 2588) but i guess this should be 28. please recheck.

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

I think tests were very weak

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

problem B

accepted code give output 29 for this input.( 88 2588) but i guess this should be 28. please make me understand.

upd: ok understood

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

I threw hard this contest and didn't solve C in contest. I solved it after tho with a somewhat unique idea. I simulated the optimal strategy for Bob to make the game last as long as possible. In order to keep it relatively fast, I also kept a reverse of the string so that I wouldn't have to keep reversing it after Bob's move. 210083837

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

Solved ABC in 30 minutes and then struggled with D. Interesting task, I was quickly able to reduce the problem to finding two segments with the largest exclusive area and was trying to transform it in a useful way but failed. Waiting for the editorial

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

Question about problem B: seems like for a following test

1
11 11299

according to the correct solution the answer is 37, but isn't it only 36, because in the best case we can get these two numbers: 99 and 9900 (I dont see how it is possible to get a sum any higher than this).

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

cool contest, problems D and E require at most 30 lines of code if you got the right idea

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

Any kind of proof for the upper bound of LCM in E?

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

    I commented this already elsewhere, just copied from there:

    We can show that the answer doesn't exceed $$$10^7$$$.

    Consider the subarrays $$$[i;i], [i;i+1], \dots, [i;n]$$$ (i.e. subarrays with a fixed left point) and their LCM's. If we go through these in order from left to right, the next segment's LCM must be a multiple of the previous one. This means that if the value changes, it must at least double. This means that within these segments starting at $$$i$$$, there can only be $$$\left\lceil\log_2 10^7\right\rceil = 24$$$ different values $$$\le 10^7$$$. This means that within all subarrays over all leftpoints $$$i$$$, there can be at most $$$n \cdot \left\lceil\log_2 10^7\right\rceil = 3 \cdot 10^5 \cdot 24 = 7.2 \cdot 10^6$$$ distinct values $$$\le 10^7$$$. Since this number is less than $$$10^7$$$, some values $$$\le 10^7$$$ must be missing, and the answer is thus $$$\le 10^7$$$.

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

      I was kind of looking for a tighter limit $$$10^6$$$ works for me and I don't think the answer would exceed that number.

      Also, I think the actual limit is smaller think about it this way you need a position for each power of a prime plus you need to kind of have some weird configuration of the array to get all values.

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

    For each i there's at most one value of lcm in a range [L, i] for each [2^j, 2^(j+1)). Let's take x being the minimum integer such that 2^x > N. Then in the range [2^x, 2^(x+1)) there's at most N values that appear as lcm of subranges, but since the range has size greater than N there must be a missing value. This proves a bound of 3 * N + 1.

    Edit: even stronger is realizing that we can generalize the observation from [2^j, 2^(j+1)) to [X, 2X). Then, for the range [N+1, 2(N+1)) there are at most N values that appear, so there's one missing and it can be at most 2N+1.

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

    It's obvious that the answer doesn't exceed $$$10^9 + 7$$$, as this number never occurs. So, we don't care about LCMs greater than this number.

    Let's choose three indices

    $$$1 \leq l \leq a \lt b \leq n$$$

    if $$$LCM(l, a) \neq LCM(l, b)$$$ then $$$LCM(l, a) \cdot 2 \leq LCM(l, b)$$$

    So, for a fixed leftpoint, the number of different LCMs doesn't exceed $$$\log(1e9 + 7)$$$

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

    We can say that 5e6 is an upper bound since there are at least 3e5 prime numbers less than 5e6

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

Such a fast rating update.

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

what is the idea of B ?

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

Could you explain me idea of problem D?

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

problem E has really weak system tests.
Just hacked an accepted solution with this test:
1
100000
6 8 6 8 ... 6 8
https://mirror.codeforces.com/contest/1834/submission/210074338

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

A: The number of occurences of -1 should be even and not greater than n/2.

B: From the first different digit of L and R from the highest digit. Let L=a1*10^m+a2 and R=b1*10^m+b2 where a2,b2<10^m, we can let 0-th to (m-1)-th digits of L become 9, and corresponding digits of R become 0. Then the answer will be at least abs(a1-b1)+9*m. We can see this is also the upperbound of the answer.

C: We can see that for Bob, reversing S and reversing T are equivalent, so Alice only need to make S==T or S==reverse(T). If Alice make k changes to transform S into T, the game will end at (2*k-1+(k+1)%2)-th turn, and if Alice make k changes to transform S into reverse(T), the game will end at (2*k-(k+1)%2)-th turn — but there's a special case: if k==0 the game will end at 2nd turn.

D: Define f(i,j) be the size of [l[i], r[i]][l[j], r[j]] (which denotes the set of numbers contained in [l[i], r[i]] but not in [l[j], r[j]]), then for any two students i, j, the difference of there height will be not greater than 2*max(f(i, j), f(j, i)). Therefore, we need to calculate max(f(i, j)) over all pairs of (i, j). We need to consider 2 cases: range i is contained inside range j, and otherwise. For the first case, we need to sort all ranges by their left-end, and for 1<=i<=n checking max(r[j]-l[j]) where l[j]<=l[i], and calculate (r[j]-l[j])-(r[i]-l[i]). For the second case, we need to check min(r[j]) where r[j]<=r[i], and calculate r[i]-max(l[i]-1, r[j]).

E: Note if p is a prime number or 1, and p is in the set of lcm, p must occur in a[i], so the answer will be at most p[n] (the n-th prime number). And for each i, the number of different values of lcm(a[j], a[j+1], ..., a[i]) below p[n] is at most log(p[n]), so we can check these values by maintaining the set L[i]={lcm(a[j], a[j+1], ..., a[i]) : 1<=j<i} in O(p[n]+n*(log(p[n]))^2) for checking n*log(p[n]) values and calculating lcm in O(log(p[n])).

F: The answer of a single query is the number of indexes i such that p[i]<i. Since there are at most 2*n different status of the array (n shifts of a[i] and n shifts of reverse(a[i])), we can pre-calculate all of them using fenwick tree.

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

A: Many straightforward approaches. What I did was count the number of +1s and the number of -1s. Make the number of -1s even (making a change if needed). After that, you can only change two -1s at a time to preserve parity, resulting in a +4 difference, so the final answer is $$$2 \left\lceil \frac{\max (0, minus - plus)}{4}\right\rceil + (minus \% 2)$$$

B: Find the first digit position in which $$$L$$$ and $$$R$$$ differ. Change all digits after this point to 9 for $$$L$$$ and 0 for $$$R$$$, resulting in a total strength of (difference at first change) + 9 * (number of digits after the first change)

C: It makes no difference whether Bob reverses $$$S$$$ or $$$T$$$, so Alice simply needs to make sure either $$$S == T$$$ or $$$S == rev (T)$$$. Count how many operations Alice needs for each of them, and pick the smaller, then count how many total operations are needed (including whether it ends on Alice's turn or Bob's "turn"). The problemsetter was very kind to place the edge-cases of $$$S == T$$$ and $$$S == rev (T)$$$ in the sample input (I legit missed both of them when I first thought I completed my code).

D: We only care about the highest hand and the lowest hand, so we basically need to find the maximum pairwise set difference between all intervals. My observation was the student with the lowest hand would have to be either: (a) the student whose interval ends the earliest, and if there are any ties, then this student has the shortest interval among them, (b) starts the latest, with shorter interval breaking ties, (c) shortest interval, with early end breaking ties, (d) shortest interval, with latest start breaking ties.

Proof Sketch: consider all cases how lowest hand interacts with highest hand: either they overlap on the left, or they overlap on the right, or the former is a subset of the latter, and in all three cases, we can see that violating all four conditions guarantees the existence of another student that would achieve a lower or equal hand (for the same choice of highest hand).

Once I found these four students, I checked all $$$n$$$ students as candidates for highest hand against each of these four students, and picked the one with the largest set difference. I'm not even sure if it's necessary to check all four, but I couldn't complete the proof for fewer than 4 low-hand candidates, so I stuck with the safe choice of checking all four.

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

During the contest, I misread the statement of problem C and thought that In turn, Alice chooses an integer i between 1 to n one of the strings S or T and any lower-case Latin letter c and replaces all occurrences of i -in the chosen string with the character c . If so, how can this problem be solved? I've tried a lot but haven't found the answer, I'm stuck and can't generate a solution, so any help would be greatly appreciated!

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

Please any hint for problem D

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

During the contest, I misread the statement of problem C and thought that In turn, Alice chooses an integer i between 1 to n one of the strings S or T and any lower-case Latin letter c and replaces all occurrences of the i -th symbol in the chosen string with the character c. If so, how can this problem be solved? I've tried a lot but haven't found the answer, I'm stuck and can't generate a solution, so any help would be greatly appreciated!

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

    You could make a graph on letters where an edge between x and y means that all occurences letters x and y must become the same letter.

    This means that for each string, the answer would be (total number of characters — number of connected components). There also might be an edge case where there are no characters that are in both strings from current component so you would have to add 1 for each of these.

    Rest is the same as C, solve for odd/even separately

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

I became Master in this round!

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

https://www.youtube.com/watch?v=qq1D83Mj4TY My solution for D

I fixed the 'ith' student to be one of the maximum/minima. and then checked for 4 cases

  1. the other student is disjoint with the ith student. In that case, the answer is the max(2*size(i),2*size(k)) for all 'k' segments disjoint with i. (which can be found using binary search and maintaining suffix maximum)

  2. the other student partially overlaps, in this case, we will take the student with the farthest start point out of all the overlapping segments ( we assume that the other student is the minima)

  3. the other student partially overlaps, and is the maximum, in this case, we take the student with the farthest endpoint.

  4. the other student is fully overlapped by the ith range, for that we will take (size(i) — minimum size of any segment which is partially/fully overlapping with the ith segment)

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

Почему в задаче С, s сводится только к t или rev(t), разве не может быть случая когда стоит взять некоторые символы из s другие из t чтобы в итоге получился палиндром и точно не потребовалось ждать ещё одного реверса от Боба?

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

    посмотри на момент финального совпадения строк. Все разы, что ты менял что-то в t можно вместо этого поменять соответствующий в s на то, с чем он должен совпасть в t.

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

What is the meaning of statement "Your solution ... have been uphacked". Is it means that my solution was hacked?

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

    It means that someone hacked your solution after contest. But notice that this a div.2 contest, which does not have an open hacking phase after the contest (you can only hack during the contest in your room for score). Since the hacking was done after the contest, you don't lose score. But this shows that systests were not strong enough to catch all wrong solutions.

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

@Ormlis, I got this mail today morning. Your solution 210063237 for the problem 1834C significantly coincides with solutions sanjaydwk/210063237, tandj_24/210066622.

But there was no such submission by tandj_24. In fact, I saw his/her profile and he/she have not solved any question in this contest. Please look into this matter asap.

Thank You!

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

Today I received a message saying that my solution for problem B and C of Codeforces Round #884 coincides with the solution of a codeforces user named AbdulRahman_Salah. [cut] I was really confused why this has happened. But then I saw that a particular design is present in both of our codes.

Problem B -

Mine || AbdulRahman_Salah

Problem C -

Mine || AbdulRahman_Salah

I've been using this template for so many previous contests and I've no idea why this has happened. Moreover, I have given around 26 contests and I have a very clean record. I am not a cheater.

I would request MikeMirzayanov to look into this matter as clearly there is no fault of mine in all this. Please help me. Codeforces, please look into this matter. I don't want to lose my expert tag. I've got it after so much hard-work.

Moreover, see this blog for more.