Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

TheForces Round #35 (LOL-Forces) Editorial

Правка en5, от Yugandhar_Master, 2024-10-01 12:40:58

A: Simple Update -I

Idea:Yugandhar_Master

Let $$$count$$$ be the number of $$$1's$$$ in the given binary string $$$S$$$.

Note that if we perform atleast one operation there will be atleast $$$k$$$ $$$0's$$$. So it is always optimal to get minimum $$$k$$$ $$$0's$$$ once we start doing operations.

Let $$$S$$$ = $$$s_1s_2s_3s_4s_5s_6s_7s_8s_9s_{10}$$$ and $$$k = 3$$$

we can do operations in the following way to get $$$k$$$ $$$0's$$$.

  1. Choose i=3, $$$S$$$ = $$$111000s_7s_8s_9s_{10}$$$

  2. Choose i=6, $$$S$$$ = $$$111111000s_{10}$$$

  3. Choose i=7, $$$S$$$ = $$$1111111000$$$.

By this way we can always get minimum of $$$k$$$ $$$0's$$$ once we start doing operations.

Hence, the answer to the problem is maximum($$$count$$$ , $$$n-k$$$).

Time Complexity : $$$O(n)$$$

solution
code(C++)

B: Simple Update — II

Idea:Yugandhar_Master

solution
code(C++)

C1: Yet Another Nim Game (Constructive version)

Idea:Yugandhar_Master

solution
code(C++)

C2: Yet Another Nim Game(Counting version)

Idea:Yugandhar_Master

solution
code(C++)

D: String From Another World

Idea:Yugandhar_Master

solution
code(C++)

E: Innocent Students

Idea:Yugandhar_Master

solution
code(C++)

F: Red Blue Tree

Idea:Yugandhar_Master

solution
code(C++)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en19 Английский Yugandhar_Master 2024-10-01 20:33:09 1 Tiny change: '/problem/F2)\n\nIdea:' -> '/problem/F)\n\nIdea:'
en18 Английский Yugandhar_Master 2024-10-01 20:32:15 32
en17 Английский wuhudsm 2024-10-01 20:29:47 2
en16 Английский wuhudsm 2024-10-01 20:27:45 84
en15 Английский wuhudsm 2024-10-01 20:27:09 663
en14 Английский wuhudsm 2024-10-01 20:06:35 0 (published)
en13 Английский Yugandhar_Master 2024-10-01 19:33:35 46 Tiny change: '03-14]\n\n<spoi' -> '03-14]\n\nFirst solve:[user:pandaforever,2024-10-01]\n\n<spoi'
en12 Английский Yugandhar_Master 2024-10-01 19:24:53 673 Tiny change: 'problem : [likes]\n\nAverag' -> 'problem : $[likes:1]$\n\nAverag'
en11 Английский Yugandhar_Master 2024-10-01 13:53:38 967
en10 Английский Yugandhar_Master 2024-10-01 13:18:43 508
en9 Английский Yugandhar_Master 2024-10-01 13:16:14 1919
en8 Английский Yugandhar_Master 2024-10-01 12:51:46 9 Tiny change: 'le Update &mdash; II](https' -> 'le Update - II](https'
en7 Английский Yugandhar_Master 2024-10-01 12:43:11 8
en6 Английский Yugandhar_Master 2024-10-01 12:41:50 68
en5 Английский Yugandhar_Master 2024-10-01 12:40:58 662
en4 Английский Yugandhar_Master 2024-10-01 12:27:43 2383
en3 Английский Yugandhar_Master 2024-10-01 12:08:58 10046
en2 Английский Yugandhar_Master 2024-10-01 10:22:05 19870
en1 Английский wuhudsm 2024-10-01 07:49:15 19358 Initial revision (saved to drafts)