wuhudsm's blog

By wuhudsm, history, 2 weeks ago, In English

A: Niimmm

Idea:Yugandhar_Master

First solve:lonely_forever

tags
solution
code(C++)
Rate the problem

B: K Palindrome

Idea:Yugandhar_Master

First solve:Egor

tags
solution
code(C++)
Rate the problem

C: Pair of GCD

Idea:Yugandhar_Master

First solve:Egor

tags
solution
code(C++)
bonus
Rate the problem

D: Perfect Prefix

Idea:Yugandhar_Master

First solve:Egor

tags
solution
code(C++)
bonus
Rate the problem

E: Any Tree ?

Idea:Yugandhar_Master

First solve:lonely_forever

tags
solution
code(C++)
Rate the problem

F: Permutation via Tree

Idea:Yugandhar_Master

First solve:methanol

tags
solution
code(C++)
bonus
Rate the problem

G: If Sort is Life

Idea:Yugandhar_Master

First solve:

tags
solution
code(C++)
Rate the problem

Full text and comments »

  • Vote: I like it
  • +21
  • Vote: I do not like it

By wuhudsm, history, 2 weeks ago, In English

Hello, Codeforces!

图片描述

We are happy to invite you to TheForces Round #37 (Brute-Forces1), which will take place on Nov/07/2024 17:35 (Moscow time)

What is TheForces Round?

You will have 135 minutes to solve 7 problems.

Spoiler

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: The participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces prize, read the above spoiler and join TheForces!

Discord Server ($$$2500+$$$ members)

TheForces website

Contests' archive

UPD:

Congrats for the winners!

1 siganai

2 pandaforever

3 Egor

And $$$2$$$ lucky participants:

funkypapaya5

XanlarIsmayilov

(Pls dm wuhudsm for your prize : ) )

Full text and comments »

  • Vote: I like it
  • +38
  • Vote: I do not like it

By wuhudsm, history, 4 weeks ago, In English

A

Idea:MathModel

Hints
Analysis
code(Python)

B

Idea:MathModel

solution
code

C

Idea:imranakki

solution
code(C++)

D

Idea:MathModel

short solution
Very Long Analysis
code

E

Idea:wuhudsm

The intended solution is $$$O(n)$$$.

solution
code(C++)

F

Idea:wuhudsm

solution
code

G

Idea:Timosh

solution
code

Full text and comments »

  • Vote: I like it
  • +14
  • Vote: I do not like it

By wuhudsm, history, 4 weeks ago, In English

Hello, Codeforces!

图片描述

We are happy to invite you to TheForces Round #36 (Starters-Forces), which will take place on Oct/25/2024 17:35 (Moscow time)

What is TheForces Round?

You will have 120 minutes to solve 6 problems. One of the problems is divided into two subtasks.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: The participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces prize, read the above spoiler and join TheForces!

Discord Server ($$$2500+$$$ members)

TheForces website

Contests' archive

UPD:

Congrats for the winners!

1 arvindf232

2 Taranenko

3 AHappyPotato

And $$$3$$$ lucky participants:

FzArK

MahmoudBassem

Dagarova.Soliha

(Pls dm wuhudsm for your prize : ) )

Full text and comments »

  • Vote: I like it
  • +14
  • Vote: I do not like it

By wuhudsm, history, 5 weeks ago, In English

In today's Codeforces Round 979, I encountered a strange situation in Problem E.

This is my submission during the contest: https://codeforces.me/contest/2030/submission/286816828. It got TLE in test #9.

However, when I modified the code as follows, it passed in about 500ms: https://codeforces.me/contest/2030/submission/286824231.

The original code:

//
dp[i&1].clear();
f[i&1].clear();
sufdp[i&1].clear();
suff[i&1].clear();
//

The modified code:

//
/*
dp[i&1].clear();
f[i&1].clear();
sufdp[i&1].clear();
suff[i&1].clear();
*/
if(i>1)
{
    for(int j=0;j<=cnt[i-2];j++)
    dp[i&1][j]=f[i&1][j]=sufdp[i&1][j]=suff[i&1][j]=0;
}
//

This is the only part I modified.

I don't understand why this code caused TLE, and I would greatly appreciate it if anyone could help.

Full text and comments »

  • Vote: I like it
  • +16
  • Vote: I do not like it

By wuhudsm, history, 2 months ago, In English

A: Simple Update -I

Idea:Yugandhar_Master

First solve:sevlll777

solution
code(C++)

B: Simple Update -II

Idea:Yugandhar_Master

First solve:sevlll777

solution
code(C++)

C1: Yet Another Nim Game (Constructive version)

Idea:Yugandhar_Master

First solve:sevlll777

solution
code(C++)

C2: Yet Another Nim Game(Counting version)

Idea:Yugandhar_Master

First solve:sevlll777

solution
code(C++)

D: String From Another World

Idea:Yugandhar_Master

First solve:Egor

solution
code(C++)

E: Innocent Students

Idea:Yugandhar_Master

First solve:sevlll777

solution
code(C++)

F: Red Blue Tree

Idea:Yugandhar_Master

First solve:pandaforever

solution
code(C++)

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By wuhudsm, history, 2 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #35 (LOL-Forces), which will take place on 01.10.2024 17:35 (Московское время)

Registration is open!

What is TheForces Round?

You will have 135 minutes to solve 7 problems.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: The participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces prize, read the above spoiler and join TheForces!

Discord Server ($$$2500+$$$ members)

TheForces website

Contests' archive

UPD:

Editorial

Congrats for the winners!

1 Egor

2 siganai

3 pandaforever

And $$$3$$$ lucky participants:

Timosh

RobinFromTheHood

Sha_mim

(Pls dm wuhudsm for your prize : ) )

Full text and comments »

  • Vote: I like it
  • +41
  • Vote: I do not like it

By wuhudsm, history, 2 months ago, In English

A An OK Problem

Idea:Binary_Thinker

Preparer:Ahmed_Jamal_Sultan

solution
code(C++)

B A Cool Pair Problem

Idea:wuhudsm

Preparer:Ahmed_Jamal_Sultan

solution
code(C++)

C Yet Another Cool Pair Problem

Idea:wuhudsm

Preparer:wuhudsm,heyyyankit

solution
code(C++)

D Tuples Fusion

Idea:wuhudsm

Preparer:Banis

solution
code(C++)

E Fun is Counting

Idea:Yugandhar_Master

Preparer:Yugandhar_Master,wuhudsm

solution
code(C++)

F Mad MAD Sum II

Idea:wuhudsm

Preparer:PROELECTRO444,wuhudsm,SpyrosAliv

solution
code(C++)

G Not an SQRT Problem

Idea:EyadBT,wuhudsm

Preparer:EyadBT,wuhudsm

Disclaimer: different from Not a Nim Problem, it is really not an SQRT problem.

solution
code(C++)

Full text and comments »

  • Vote: I like it
  • +31
  • Vote: I do not like it

By wuhudsm, history, 2 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #34 (ABC-Forces), which will take place on Sep/17/2024 17:35 (Moscow time)

What is TheForces Round?

You will have 135 minutes to solve 7 problems.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: the participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces Prize, read the above spoiler and join TheForces!

Discord Server (2200+ members)

TheForces website

Contests' archive

UPD:

Editorial

Congrats for the winners!

1 potato167

2 ttamx

3 Rubikun

And $$$3$$$ lucky participants:

Shakil17

MinaMagdy1

zesty

(Pls dm wuhudsm for your prize : ) )

Full text and comments »

  • Vote: I like it
  • +78
  • Vote: I do not like it

By wuhudsm, history, 3 months ago, In English

A: Mr.Wow and Lucky Array

Idea:Yugandhar_Master

solution
code(C++)

B: Mr.Wow and Dislikes

Idea:Yugandhar_Master

solution
code(C++)

C: Mr.Wow and Spells

Idea:Yugandhar_Master

solution
code(C++)

D: Mr.Wow and Multiset

Idea:wuhudsm

solution
code(C++)

E: Mr.Wow and Hidden Permutation

Idea:Yugandhar_Master,wuhudsm

solution
code(C++)

F: Mr.Wow and Decoding

Idea:Yugandhar_Master

solution
code(C++)

Full text and comments »

  • Vote: I like it
  • -19
  • Vote: I do not like it

By wuhudsm, history, 3 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #33 (Wow-Forces), which will take place on Aug/12/2024 17:35 (Moscow time)

What is TheForces Round?

You will have 135 minutes to solve 6 problems.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: the participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces Prize, read the above spoiler and join TheForces!

Discord Server (2200+ members)

TheForces website

Contests' archive

UPD:

Editorial

Congrats for the winners!

1 tiger2005, ORZ for the only AK!

2 turkhuu622

3 pandaforever

And $$$2$$$ lucky participants:

skushneryuk

Joy_saha_

(Pls dm wuhudsm for your prize : ) )

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it

By wuhudsm, history, 4 months ago, In English

A: Short Query

Idea:Yugandhar_Master

solution
code(C++)

B: Minimum MEX

Idea:Yugandhar_Master

solution
code(C++)

C: Range Contradiction

Idea:Yugandhar_Master

solution
code(C++)

D: Eleven

Idea:Yugandhar_Master

solution
code(C++)

E: Not a Segment Tree

Idea:Yugandhar_Master

solution
code(C++)

F2: Award from Wuhudsm(Hard Version)

Idea:Yugandhar_Master

solution
code(C++)

Full text and comments »

  • Vote: I like it
  • +12
  • Vote: I do not like it

By wuhudsm, history, 4 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #32 (2^5-Forces), which will take place on Jul/21/2024 17:35 (Moscow time)

What is TheForces Round?

You will be given 6 problems and 2 hours to solve, one of the problems is divided into two subtasks.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: the participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces Prize, read the above spoiler and join TheForces!

Discord Server (2200+ members)

TheForces website

Contests' archive

UPD:

Editorial

Congrats for the winners!

1 risujiroh

2 Kude

3 Aging1986

And $$$3$$$ lucky participants:

gultai4ukr

aps236875

vitosevskich

(Pls dm wuhudsm for your prize : ) )

Full text and comments »

  • Vote: I like it
  • +23
  • Vote: I do not like it

By wuhudsm, history, 4 months ago, In English

Thank you for participation and we hope you enjoy this round :)

Additionally, we sincerely invite you to join the unofficial round of TheForces Community tomorrow. Compete alongside many high-rated participants and earn your own rating in a our own rating system(TheForces Rating System)!

For more details, pls read https://codeforces.me/blog/entry/131733.

A — Submission Bait

hint1
hint2
solution 1
solution 2
code(solution 1)

B — Array Craft

hint1
hint2
solution
Bonus
code

C — Mad MAD Sum

hint1
hint2
hint3
solution
code
fun fact

D Grid Puzzle

hint1
hint2
hint3
solution
code(greedy)
code(DP)

E Catch the Mole

hint1
hint2
hint3
hint4
solution1
solution2
bonus
code(hard version)

F Polygonal Segments

solution1
solution2
code(solution 1)
code(solution 2)

Full text and comments »

  • Vote: I like it
  • +92
  • Vote: I do not like it

By wuhudsm, history, 4 months ago, In English

Hello Codeforces!

I have the pleasure of inviting you to participate in Codeforces Round 960 (Div. 2), which will start on Jul/20/2024 17:35 (Moscow time).

The problems were prepared and authored by wuhudsm.

You will be given 6 problems and 2 hours to solve, one of the problems is divided into two subtasks.

One of the problems may be interactive. So, please refer to the guide on interactive problems if you are unfamiliar with them.

I would like to thank:

Fun fact

Good luck and have fun!

Score distribution: $$$500 - 1000 - 1500 - 1750 - (2000+750) - 3000$$$

UPD:

Editorial

Congrats for the winners!

Div 2:

  1. 0101byc

  2. Psychotic_D

  3. roIandpetrean

  4. skahl15

  5. thawin.ice

Div 1+Div 2:

  1. tourist

  2. jiangly

  3. noimi

  4. Sugar_fan

  5. 0101byc

Full text and comments »

  • Vote: I like it
  • +575
  • Vote: I do not like it

By wuhudsm, history, 5 months ago, In English

A

Idea:Yugandhar_Master

solution
code(C++)

B

Idea:beyondpluto

solution
code(C++)

C

Idea:Yugandhar_Master

solution
code(C++)

D

Idea:wuhudsm

Preparer:PROELECTRO444

solution
code(C++)

E

Idea:HexShift

solution
code(C++)

F

Idea:Yugandhar_Master

solution
code(C++)

G

Idea:vikram108

solution
code(C++)

Full text and comments »

  • Vote: I like it
  • +13
  • Vote: I do not like it

By wuhudsm, history, 5 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #31 (Div2.9-Forces), which will take place on Jul/01/2024 17:35 (Moscow time)

What is TheForces Round?

You will have 135 minutes to solve 7 problems.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: the participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces Prize, read the above spoiler and join TheForces!

Discord Server (2200+ members)

TheForces website

Contests' archive

UPD:

Editorial

Congrats for the winners!

1 siganai, orz for the only AK!

2 pandaforever

3 Yam

And $$$4$$$ lucky participants:

tfgs

noob_username

bahodirov360

amirhozaifa

Full text and comments »

  • Vote: I like it
  • +59
  • Vote: I do not like it

By wuhudsm, history, 7 months ago, In English

A

Idea:Yugandhar_Master

solution
code(C++)

B

Idea:Yugandhar_Master

solution
code(C++)

C

Idea:Yugandhar_Master

solution
code(C++)

D

Idea:Yugandhar_Master

solution
code(C++)

E

Idea:Yugandhar_Master

solution
code(C++)

F

Idea:Yugandhar_Master

solution
code(C++)

G

Idea:Yugandhar_Master

solution
code(C++)

Full text and comments »

  • Vote: I like it
  • +15
  • Vote: I do not like it

By wuhudsm, 7 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #30 (Good-Forces), which will take place on Apr/28/2024 17:35 (Moscow time)

What is TheForces Round?

You will have 150 minutes to solve 7 problems.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: the participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces Prize, read the above spoiler and join TheForces!

Discord Server (2200+ members)

TheForces website

Contests' archive

UPD:

Editorial

Congratulations to the winners:

1.ksun48

2.siganai

3.Kude

(ksun48 orz for getting the only AK!)

And $$$3$$$ lucky participants:

WizzyRocky

avighai17

cry

(Pls DM wuhudsm in CF or Discord for your prize :) )

Full text and comments »

  • Vote: I like it
  • +35
  • Vote: I do not like it

By wuhudsm, history, 8 months ago, In English

A

Idea:wuhudsm

solution

B

Idea:ishat_jha

solution

C

Idea:imranakki

solution

D

Idea:KitasCraft

solution

E

Idea:KitasCraft

solution

F

Idea:imranakki

solution

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it

By wuhudsm, 8 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #29 (Clown-Forces), which will take place on Mar/31/2024 17:40 (Moscow time)

What is TheForces Round?

This is an April Fools style contest, we hope you all have fun 😜

You will have 120 minutes to solve 6 problems.

Prizes: The first solver of each problem will win $$$1$$$ dollar as a prize. In addition, the first non $$$-$$$ penalty solver of each problem will win $$$1$$$ dollar as a prize too. Please actively participate 🤤

For more details about TheForces Prize, please join our Discord Server (2000+ people).

Contests' archive

Editorial

UPD:

Congrats for the first solver and the first non $$$-$$$ penalty solver!

The first solver:

A:Mehdi_Ba

B:DylanSmith

C:AHappyPotato

D:Ace_42

E:A_G

F:temmieowo

The first non $$$-$$$ penalty solver:

A:Mehdi_Ba

B:DylanSmith

C:Little_Sheep_Yawn

D:Ace_42

E:A_G

F:temmieowo

(pls DM wuhudsm for your prize :) )

Full text and comments »

  • Vote: I like it
  • +60
  • Vote: I do not like it

By wuhudsm, history, 8 months ago, In English

A Minimum Black Cells

Idea:wuhudsm

code
solution

B Sequence Duplication

Idea:wuhudsm

code
solution

C Perfect Square Matrix

Idea:wuhudsm

code
solution

D Tree Merger

Idea:wuhudsm

code(solution 1)
code(solution 2)
solution1
solution2

E RBS Score

Idea:wuhudsm

code
solution

F Too Many BSTs

Idea:Yugandhar_Master

Solution:wuhudsm

code
solution

Full text and comments »

  • Vote: I like it
  • +32
  • Vote: I do not like it

By wuhudsm, history, 8 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #28 (Epic-Forces), which will take place on Mar/14/2024 17:35 (Moscow time)

What is TheForces Round?

You will have 180 minutes to solve 6 problems.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes: the participant in the $$$i$$$th place will receive $$$2^{3-i}$$$ dollars $$$(1 \leq i \leq 3)$$$ as a prize. In addition, we will randomly select $$$\lfloor \frac{p}{30} \rfloor$$$ lucky participants and give each of them $$$1$$$ dollar as a prize, where $$$p$$$ is the number of participants. Please actively participate :)

For more details about TheForces Prize,please join our Discord Server (1000+ people).

Contests' archive

UPD1:Editorial

UPD2:

Congratulations to the winners:

1.BurnedChicken

2.pandaforever

3.Kude

(BurnedChicken orz for getting AK in only $$$83$$$ minutes)

And $$$2$$$ lucky participants:

Justinshao

hararsa

(Pls DM wuhudsm in CF or Discord for your prize :) )

Full text and comments »

  • Vote: I like it
  • +17
  • Vote: I do not like it

By wuhudsm, 9 months ago, In English

Thank you for participation and we hope you enjoy this round :)

D2A — Shuffle Party

Idea : chromate00

Hint (for thinkers)
Hint (for observers)
Tutorial
solution

Video editorial by aryanc403 https://www.youtube.com/watch?v=lLmVzA49BRM

D2B — Binary Path

Idea : wuhudsm

Hint1
Hint2
Hint3
Tutorial
solution

D1A — Bitwise Operation Wizard

Idea : wuhudsm

Hint1
Hint2
Hint3
Tutorial
solution

Video editorial by aryanc403 https://www.youtube.com/watch?v=jfcx1Rs8I28

D1B — Pinball

Idea : wuhudsm

UPD: It conflicts with https://mirror.codeforces.com/contest/733/problem/E. This is a coincidence. There are no excuses. Very sorry for any inconvenience caused to everyone.

Hint1
Hint2
Hint3
Tutorial
solution

D1C — Pokémon Arena

Idea : wuhudsm

Hint1
Hint2
Hint3
Tutorial
solution

Video editorial by aryanc403 https://www.youtube.com/watch?v=ysdozposXkQ

D1D — Bitwise Paradox

Idea : Psychotic_D, MagicalFlower

Tutorial
solution

D1E — Yet Yet Another Permutation Problem

Idea : wuhudsm

Hint1
Hint2
Hint3
Tutorial
solution

D1F — Grand Finale: Circles

Idea : chromate00

UPD: The TL was a bit too loose, and unintended solutions with $$$\mathcal{O}(n \log^2 (1/\epsilon))$$$ complexity passed during the round. For the sake of the problem itself, I suggest that you try to solve assuming a $$$1$$$ second time limit.

Tutorial
solution

Full text and comments »

  • Vote: I like it
  • +192
  • Vote: I do not like it

By wuhudsm, history, 13 months ago, In English

Hello, Codeforces!

We are happy to invite you to TheForces Round #24 (DIV3-Forces), which will take place on Oct/13/2023 17:35 (Moscow time)

What is TheForces Round?

You will have 135 minutes to solve 7 problems.

The round is TheForces rated! After the round you can find your rating changes here.

Prizes:the participant who ranked $$$i$$$ will received $$$(6-i)$$$ dollars $$$(1 \leq i \leq 6)$$$ as a prize.In addition,we will randomly select $$$5$$$ lucky participants and give them $$$1$$$ dollar as a prize.Please actively participate!

(We only support bitcoin and PayPal payments. If you cannot use them, your prize will be donated to TheForces Prize Pool by default and you'll get "sponsor" role.The same applies to cases where you haven't contacted wuhudsm for prizes within three days. )

For more details about TheForces Prize Pool,please join our Discord Server (1000+ people).

Contests' archive

UPD:

Congratulations to the winners:

1.liympanda

2.Aging1986

3.cuiaoxiang

4.aufannn

5.pavlekn

And $$$5$$$ lucky participants:

9.FelixArg

33.__AB__

38.abhi_atg

93.MahmoudKhater

98.aman1009

(Pls DM wuhudsm in CF or Discord for your prize :) )

Editorial

Full text and comments »

  • Vote: I like it
  • +66
  • Vote: I do not like it