cry's blog

By cry, 6 days ago, In English

Codeforces!

Proof_by_QED, chromate00, larush, Edeeva, and I would like to invite you to participate in Codeforces Round 1003 (Div. 4), starting on Feb/09/2025 17:35 (Moscow time). We have baked $$$8$$$ problems to be solved in $$$2$$$ hours and $$$15$$$ minutes. We hope the problems will be interesting, unique...and skibidi.

The format of the event will be identical to Div. 3 rounds:

  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), you may choose to participate rated or unrated.

Large text, to get your attention for the following:

PLEASE NOTE the rule restricting AI use. If you are caught using AI in an unorthodox manner, either by us manually or detected automatically, YOUR ACCOUNT WILL BE TERMINATED. We will be actively scouring submissions and terminating rulebreakers.

Anyways, I would like to orz the following:

UPD: Editorial

UPD2: Regarding Skipped Submissions

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

»
6 days ago, # |
  Vote: I like it +39 Vote: I do not like it

Participate for a fumo.

  • »
    »
    6 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Oh cry also play Honkai : Star Rail.

    • »
      »
      »
      5 days ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      Don't you know cry has made multiple problem based on hsr?

    • »
      »
      »
      2 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      That's why Round 971 F/G?

  • »
    »
    6 days ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

»
6 days ago, # |
  Vote: I like it +22 Vote: I do not like it

As a testerproblemsetter, I really don't know how eating crayons affected cry's problemsetting skills

  • »
    »
    6 days ago, # ^ |
      Vote: I like it +12 Vote: I do not like it

    As a tester, I'm thankful to the crayons for affecting cry's problemsetting skills, because I don't think we would have gotten such a skibidi round otherwise.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

As a new user in CodeForces,I hope it will be great.

»
6 days ago, # |
  Vote: I like it +12 Vote: I do not like it

As a tester, this round was quite skibidi.

»
6 days ago, # |
  Vote: I like it +2 Vote: I do not like it

when is the next rollback?

»
6 days ago, # |
  Vote: I like it +3 Vote: I do not like it

As an author, instead of eating crayons 15 years ago, I ate snacks from the floor 10 years ago.

  • »
    »
    6 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    As a tester, I still eat snacks from the floor.

»
6 days ago, # |
  Vote: I like it +6 Vote: I do not like it

As a testuwuer, this is my first time testing a round! Hope everyone enjoy the problems.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

As a tester, I am sure this round will be not only skibidi, but suspicious as well.

»
6 days ago, # |
  Vote: I like it -9 Vote: I do not like it

Chatgpt o3 mini was able to solve all problems of a recent div4 which I tried. I hope problems after D are non ChatGPTable since your rounds are more towards the standard side cry

  • »
    »
    6 days ago, # ^ |
      Vote: I like it +24 Vote: I do not like it

    I would advise you to not focus on whether problems are GPTable or not, and focus more on enjoying the problems. Best of luck!

    • »
      »
      »
      6 days ago, # ^ |
        Vote: I like it -11 Vote: I do not like it

      o3 mini COMPLETELY solves Codeforces Round 962 (Div. 3) and its a Division 3 contest. If you haven't taken any special care then sim pretty sure first page of standings will just be cheaters considering this is a Division 4 contest.

      • »
        »
        »
        »
        6 days ago, # ^ |
          Vote: I like it +16 Vote: I do not like it

        So what is the point of saying all of this? Are you planning on cheating? We have already said in the announcement that any accounts suspected of using AI will be banned, either by us or by plagiarism checker after the contest.

        • »
          »
          »
          »
          »
          6 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I don't cheat and if the problems are not gpt proof it will be impossible to catch if someone implements the code of ai on their own.

          Why would I cheat I'm asking you to make problems non gptable.

          • »
            »
            »
            »
            »
            »
            6 days ago, # ^ |
              Vote: I like it +31 Vote: I do not like it

            Personally, I would far prefer a problem that's 10% more fun/interesting but GPT'able than a problem that's less interesting but GPT-proof. Whether people cheat or not is not my concern. I imagine most people in the community feel this way — why should we sacrifice our enjoyment just because other people want to cheat?

            Of course, in an ideal world, the problems would be both interesting and GPT-proof. But problem setting is hard. I've tried coming up with problems in my spare time, and I've come up with nothing remotely passable. If you think you can do it, then go ahead and try. If you think cry's rounds are unsuitable, then don't compete in them. But don't just expect setters to be able to magically produce perfect problems that are both enjoyable to solve and perfectly GPT-proof.

            • »
              »
              »
              »
              »
              »
              »
              6 days ago, # ^ |
              Rev. 2   Vote: I like it +10 Vote: I do not like it

              Completely agree with this. To be honest, I think whether a problem can be solved by AI should be the last concern. It has already become too difficult to make only problems that are GPT-proof, especially when the problems are supposed to be easy, and in a near future it will be almost impossible even to make GPT-proof Div. 2 problems. I don't want problemsetters to suffer from interesting problems being rejected just because of this. It's only our job to improve general conciousness on cheating and contest writers should be free from such burdens.

            • »
              »
              »
              »
              »
              »
              »
              3 days ago, # ^ |
                Vote: I like it -9 Vote: I do not like it

              we want to become a CM and Master to have a feeling that i have achieved something big (without cheating) and want to show in industry that we are capable of high logical thinking for jobs (without cheating) but because of cheating we are unable to achieve this as rating based on rank.....so how Whether people cheat or not is not our concern.

              • »
                »
                »
                »
                »
                »
                »
                »
                3 days ago, # ^ |
                  Vote: I like it +26 Vote: I do not like it

                Nobody cares about your codeforces ranking mate.

                There are less than 3000 Masters on this site. Do you really think being a master will get a you job? If anything, if it's the only thing you are doing, it'll just make you even more unemployable. Unless you wanna be support/mentor for TLE Eliminators LOL.

                Your job won't require high logical thinking anyway ,you are just going to build CRUD apps.

                Stop worrying about the cheaters, stop putting your self worth — your job prospects — your percieved intelligence — whatever behind a useless number.

                If you like CF, if you like math, if you like solving puzzles, so be it. Solve some problems. Don't go on a wild goose chase, looking for an unattainable goal.

                But i digress, monkey brain sees big number, monkey brain likes. Monkey brain gets the big number without effort thanks to AI? Monkey brain doesn't feel anything. So yeah, I too don't understand the motive behind cheating here. If it's really the job prospects, I think they might be literally retarded.

                Also unrelated, a simple fix is jsut to have a registered phone number to be able to join contests. It's just gonna deter so many...uhm...people. See how I posted this from a fake account, just because I can.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  For a 3rd tier college student in India CP is the only(or 1 one of very less) way to get in big product base giant..... No matter whether you have to build crud app only in jobs.....if you have only experience in building a crud app with a 3rd tier college tag even your resume donnot get shortlisted offcampus..... Only a 3rd tier college student with dream of getting into tech giant know what these tag of master and CM mean to them and how this is their only way to shadow there 3rd tier college in resume to get their resume shortlisted in tech giant like google, Microsoft, atlassian etc

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  if reaching CM was only way to get job then why are there so few CMs in India(means there is only few people who are employable)?

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  i like cp

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 days ago, # ^ |
                  Rev. 3   Vote: I like it 0 Vote: I do not like it

                  Not only few people are employable but only few have cleared big tech giant from a 3rd tier college and mostly those are CM, Master.....

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  3 days ago, # ^ |
                    Vote: I like it +7 Vote: I do not like it

                  This exact line of thinking will ALWAYS keep you down in life.

                  Lets do some quick math, as we all love it here. There are a total 4421 Indians that have more than 1400 rating, which is the floor for Specialist. (not EXPERT, not CM, nor Master, mind you). Lets say 1/3rd of them are T3 collage students/grads. That leaves ~1500. Say, half of them are already employed. Leaves us 750. Are you seriously telling me that, in the country with 1e9 population, you have only 750 competitors? What an awesome thing is that. (by my metric, by yours its even more laughable) You see, there is a contradiction here. Because if what you said is true, you couldn't possibly be unemployed, right?

                  Stop projecting the blame into irrelevent things. I design industrial fire suppression systems in my day job. If I can get to 1400 (not a CS major, not a Math major, a plain engineer), shame on you if you cannot with some practice, cheaters or otherwise.

                  My friend, you need a change of perspective on life.

                  My suggestion for you is, follow the teachings of Marcus Aurelius. A bit of stoicisim never hurt anyone. Or, you might join the cheater crew, if you think that helps your chances. (I assume it wont though, just seeing the numbers) Last option is, you can do nothing except complain, complain about cheaters, complain about your university, complain about your grades, complain about Milky Way..Maybe life would be better if you were just born in some planet at Andromeda galaxy. Who knows...

                  Once again for the last time, stop projecting. Take responsibility, only then you can have control over your life. Nobody can teach you how to get a job at a tech giant but one thing is crystal clear enough, it's not about your CF rank.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  47 hours ago, # ^ |
                    Vote: I like it +1 Vote: I do not like it

                  Very honestly no one gives a shit about codeforces rating except for HFTs which ofc wouldnt hire you unless you are atleast a master.... If you want a job, start building projects, write papers, do internships or solve questions on leetcode. You are wasting your time if you if you think that codeforces would get you a job. Do codeforces only if you are really into problem solving and find it relaxing/fun.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  31 hour(s) ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  what the hecklers

              • »
                »
                »
                »
                »
                »
                »
                »
                3 days ago, # ^ |
                Rev. 3   Vote: I like it +1 Vote: I do not like it

                Yes, there are people like you, who do Codeforces because they want a high rating, because they want to be more employable. Yes, people like you are hurt by cheating.

                But at the end of the day, we can't cater this platform to everybody. If I had to choose between catering the platform to people like you, and people like me (i.e. people who do this as a hobby purely for enjoyment), I would pick the latter every time. The CP community is primarily built upon the people who do it because they love it, not the people who just want a job. If people like you suffer from this, it's unfortunate but it is what it is. Go do LeetCode instead or something.

                Edit: Just to be clear, I'm not saying I don't care about ratings, nor that people in general should not care about their ratings. Of course that's part of the competition. But the rating scale still holds among non-cheaters, regardless of whether other people are cheating. It's not as if ratings are entirely meaningless, so long as you're comparing yourself to the innocent populace.

  • »
    »
    6 days ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    atleast last 4 problems shouldnt be gptable

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

As a testuwuer, I can confirm that there are at least 8 problems and no more than 8 problems that need inputing and outputing.

»
6 days ago, # |
  Vote: I like it +9 Vote: I do not like it

as a tester, i lost an ungodly amount of braincells reading the problem statements. best of luck

  • »
    »
    6 days ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    I started grinding IELTS for codeforces rounds.

»
6 days ago, # |
  Vote: I like it +3 Vote: I do not like it

first time I will be out of competition ;)

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

cry made me addicted to crayons

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can any tester tell me how many problems I can do or how many problems are of a newbie level
who has done 2 problems in div . 1 + 2 and 3 problems in div . 4 .

  • »
    »
    5 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    For obvious reasons, they can't say that, but my estimate would be a newbie could 3-4 problems

»
6 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I think the last problems will not with rating 2000+ like this 2044H - Hard Demon Problem

»
6 days ago, # |
  Vote: I like it +5 Vote: I do not like it

As a newly-ordained [VIP-] testuwuer — I assert that if you do not participate in this skibidi sigma round, the gang of testuwuers will fanum tax you out of existence and send you to the depths of Ohio.

»
6 days ago, # |
  Vote: I like it -20 Vote: I do not like it

man its going to be a massacre. It should be unrated honestly.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

As a participant, I love the AI restriction rule

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

As a tester, the round is more skibidi than anything I've seen before

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

As a tester, I promise that all problems are good! Have fun!

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

cry will make us "cry" this time ...

  • »
    »
    3 days ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Don't worried, this is Div 4, all problems are easy

»
6 days ago, # |
  Vote: I like it -13 Vote: I do not like it

will there be a 2700 rated problem this round?

»
6 days ago, # |
  Vote: I like it +5 Vote: I do not like it

Hope to reach specialist

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

First time the round is rated for me, but I'm not a trusted participant.

»
6 days ago, # |
  Vote: I like it +5 Vote: I do not like it

Really wanted to participate, but can't.

BdOI (Bangladesh Olympiad in Informatics) preli in the that day :sob:

»
5 days ago, # |
  Vote: I like it +5 Vote: I do not like it

As a participant, i wish everyone a positive delta

»
4 days ago, # |
  Vote: I like it +30 Vote: I do not like it

as a tester

»
4 days ago, # |
  Vote: I like it +14 Vote: I do not like it

why are all testers>= blue for a div 4 :(

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

This is going to be my first contest on this platform. Too excited!

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

are rule restricting AI use also hold for unrated participant?

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

i hope that someday i test some contest .

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Finally, it has been Long awaited

»
4 days ago, # |
  Vote: I like it +6 Vote: I do not like it

As a tester, I can confirm I didn't eat crayons 15 years ago, because I didn't have one.

»
4 days ago, # |
  Vote: I like it +7 Vote: I do not like it
  • »
    »
    4 days ago, # ^ |
      Vote: I like it +25 Vote: I do not like it

    I wish I don't need this in this contest(in a good way).

»
4 days ago, # |
  Vote: I like it +30 Vote: I do not like it

Finally unrated

  • »
    »
    4 days ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Congratulations, it's a good way.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    bro trying to create a fish tank using codeforces rating graph

»
4 days ago, # |
  Vote: I like it 0 Vote: I do not like it

AI

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hoping to solve three problems in this contest! :)

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

What is the penalty for resubmission?

  • »
    »
    3 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    There is no penalty for resubmission in Extended ICPC format.

»
3 days ago, # |
  Vote: I like it +3 Vote: I do not like it

skibidi

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

first time taking part in a contest. i hope it goes well

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

i hope it goes well for me and everyone else too.

»
3 days ago, # |
  Vote: I like it +3 Vote: I do not like it

Here only because larush gaslighted me (in a good way) to be here.

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

all the best everyone give your 100% with best wishes

»
2 days ago, # |
  Vote: I like it 0 Vote: I do not like it

My Birthday Round!(Not today, it's October 3th)

»
2 days ago, # |
  Vote: I like it +1 Vote: I do not like it

If there is no problem about the Super Bowl I will cry.

»
2 days ago, # |
Rev. 2   Vote: I like it -7 Vote: I do not like it

HahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahah HahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahah HahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahah HahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahah HahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahah HahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahah HahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahahhahahahahhahahahahhahahahahahahahahaHahahahahah

Can you count the difference between number of H and h?

I expect these kind of problems from Div4, hopefully i will become pupil.

»
2 days ago, # |
  Vote: I like it +2 Vote: I do not like it

cry Proof_by_QED can i use AI for testing during the contest because this contest is unrated for me.

»
47 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

How to register? This is my the first competiton.

»
44 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

hopefully i don't mess this up :pray:

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    update: i messed it up, can't mess the next one (rating free fall)

»
43 hours ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

Dear Server Gods,

Please don't crash out in Ohio and lemme skibidi smash this contest!

Thanks, Your G

»
43 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

Hoping to AK this one !!

»
43 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

wow great!

»
43 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I can proudly announce that I am out of competition Thank You

»
43 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

No cheating.

»
43 hours ago, # |
Rev. 2   Vote: I like it -7 Vote: I do not like it

Why cry can write div4 every time?

»
43 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

GLHF

»
43 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

specialist after this one, less go

»
41 hour(s) ago, # |
  Vote: I like it +22 Vote: I do not like it

as the kids say, I wanna unalive myself (in minecraft) after reading (and solving) this round problems' legends.

»
41 hour(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

very bad contest; very bad problems; extremely gutted and disappointed on myself :(

  • »
    »
    41 hour(s) ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i feel like problems D onwards are nice, would not say such about c1, c2

»
41 hour(s) ago, # |
  Vote: I like it +17 Vote: I do not like it

I have a question: How many hours have authors been watching brainrot content?

»
41 hour(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

how to solve c1? ...

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    minimize a[i] while making sure that a[i] is >= a[i — 1]

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Hint: first chose minimum of x and B[0]-x every time otherwise choose maximum of them while building the sequence if we can't make the sequence then ans is no

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

E's explanation please

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Consider a String with k 0s at the begin, then alternating 1010... then the rest of the string 1s. This is allways constructable if n>=m.

    Else we just switch all 1s to 0s and vice versa.

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Felt today, absolutely dumb.

»
40 hours ago, # |
  Vote: I like it +42 Vote: I do not like it

In my opinion, today's problem set is too hard for a Div 4; I would say it is apparently closer to a Div 3 one.

I wonder how the coordinators nowadays determine if a contest should be Div 3 or 4 (open for discussions). Are we labeling a contest as Div 4 just to attract more registrants?

A too-hard Div 4 could discourage complete beginners from joining the CP community. As a personal suggestion, maybe only mark contests with significantly easier problems as Div 4 in the future.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    I think it is too hard for div.4 too. As an expert, I cannot even be rated on div.3, and I expect I can AK div.4 or at least only not solve the last question. However, I could only solve 7 questions, and questions beyond A and B are quite stressful for me.

    I cannot get an idea of algorithm of F, and for H, not even adding the queries is already quite difficult. H feels like 2200 rating, which is way too difficult for div.4.

»
40 hours ago, # |
  Vote: I like it +24 Vote: I do not like it

So many green/gray talents

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

So glad that wasn't rated for me. I took way too long to realize the trick on C1

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you share the trick?

    • »
      »
      »
      40 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Not really sure if it's a trick necessarily, but I originally didn't consider that not only can a number in the array become smaller, you can also use the number in array B to have the current number in array A become larger as well which helps in some cases. I.E. in the example A=[1,2,1] and B=[4], you can do B[0]-A[2] to get the array A=[1,2,3]

    • »
      »
      »
      40 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      For each a[i], minimize a[i] as much as possible while ensuring that a[i] ≥ a[i−1].

    • »
      »
      »
      40 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      when considering a[i], you must also check if a[i — 1] > a[i] because then u have to set a[i] to b[0] — a[i] (if a[i — 1] <= b[0] — a[i], otherwise the answer is no)

      • »
        »
        »
        »
        38 hours ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Hey, I am trying problem c2 for a while but i am getting WA for a test case.Can anyone tell me which it could be?

        Here is my submission: 305359434

»
40 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

Thank you for the problems!

»
40 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

Overall interesting contest. Not really what I expected out of a div 4. Problem order is a bit weird. I couldn't solve C1 or C2 despite solving D and E.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    What was the idea behind E? can you please explain. Is the question related to greedy algorithm? I was able to solve up to D but got stuck on E

»
40 hours ago, # |
  Vote: I like it +32 Vote: I do not like it

Amazing how the front page is filled with pupils/newbies with consistent 10k performances, but AK in 1h 15...

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

What optimization am I missing in F ? 305341654 Keep getting TLE for testcase 16

  • »
    »
    40 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    A path with a majority element can be made shorter, so that there is a smaller subpath as {a[i], a[j], a[i]}

    So we need to check only if there are any neigbour vertices with same a[i], or any parent with two childs with same a[i].

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Use a set to check if a[k2] is in adj[k1]. I implemented this: 305334519

    • »
      »
      »
      40 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yeah ok, I found why I could get TLE. I failed the correct implementation. Pissed, cause I had the idea

      • »
        »
        »
        »
        40 hours ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Actually you iterate all paths of len 3. That can be a lot. Think about a center vertex, and all others attached to it.

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

is there a way to solve b without using stack?

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You only need to check if the string has duplicates.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    if there is at least one pair the answer is 1 because you can always make new pair using the new character

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, simple logic is that if any consecutive matching characters are present, then the answer is straightaway 1 as the two characters can be replaced by any character, which can always be another neighbouring character that continues the match of two adjacent characters for another replacement until it reaches 1. To check for adjacency, a simple loop on the indices can be used. If no such adjacent matching characters were found, the entire length of the string will remain as-is without any operation, giving answer as the length of the original string.

    • »
      »
      »
      40 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      oh didn't realise took a long time implementing with stack. there goes my positive delta :(

      • »
        »
        »
        »
        40 hours ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Don't fret. Learn with this problem experience and hopefully it will help you gain rating in the future rounds :)

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    In the original string, if there is not a doubled letter, then no operation can be performed. Else, you can always replace it by any of the neighbouring letters and allow for a further operation to be performed. Eventually, the string size will always reach 1.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    b problem is just simple observation if you found pair of equal elements then the answer will be 1 otherwise answer will be n(size of array) you can dry run some test cases to validate it like abbcde -> accde -> adde -> aee -> aa -> a

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, the answer is simply 1 if there are 2 adjacent characters that are the same, otherwise, it is the size of the string.

»
40 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Codeforces is now a days a joke! how these problems can come in Div4 ? problem setters should be allowed based on their experiences of the particular round! Can you imagine how this contest can discourage the people who made their first contest in div4 Today? Be respectful to everyone, Not to show your skills. If you are that much talented set problems for div1. Thank you!

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I experienced brain death at C1

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Spent too much time overcoming edge cases, knew C2 was doable with binary search but couldn't implement in time

»
40 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

305337533

can anyone say me why this doesnt work for C1?? if i run it in vs code it passes the testcases but when i submitted it is showing runtime error.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can execute your code in the 'Custom invocation' section to check that kind of problems :)

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    the type of sol function should be void not int

    I think this is the problem with your code (I saw this error before in a friend's code)

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Solved problem E just 1 minute after contest got over.
I will not be able to forgive myself. :(

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

thank you very much for the round. Might reach specialist this time.

»
40 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

How on the earth this is a div4 round?? C2 is a div2C category problem.

  • »
    »
    40 hours ago, # ^ |
    Rev. 2   Vote: I like it +3 Vote: I do not like it

    C2 was the same as C1 once you got the idea for C1. Just needed to apply binary search to optimize the condition you found in C1

    • »
      »
      »
      40 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yeah but usually div4 round offers first 3-4 problems quite easy but the problems were not beginner friendly .

  • »
    »
    39 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Did you take a look at D and E? Testers and authors know that C2 was harder than them, but since C was subtasked they should be together

    • »
      »
      »
      27 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yep, D and E were easy . I was only judging for C1+C2 . They should have been swapped place and sorry for my wrong judging :)

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

this div 4 round really felt like a div 3 one

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

It was way too tough

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    definitely, considering that it's made for completely beginners

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I submitted f problem 5 sec before end ,but due to server issue it isnt submitted.Its not my fault ,also this is not the 1st time it happned , plz do something about system

»
40 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

A -> Simple and Fun
B -> Think a bit and fun to solve
C1 -> Actual Torture and requires a lot of thinking
C2 -> C1 copy pasta with Binary Search (still torture)
D -> Pretty cool problem but sol code will probably TLE
...
No time left

Overall, a pretty tough contest for DIV-4 (T-T)

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

My first contest. I've been studying PS for two months. Spent 2 hours on C1. Now I feel like I'm dumb.

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

how to do H

  • »
    »
    40 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Didn't have time to submit the solution, but I guess you have to consider the individual contribution to the total sum by each element. Basically, every element adds 1 to the total sum, if his left neghbour is [empty] or the opposite of the current element. So for each element you have to count the quantity of all subsequences that satisfy the condition above.

    • »
      »
      »
      40 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      bro i did not even think it like that! thanks for the hint, i was thinking something else entirely.

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve E?

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Substring can always be the whole string so if you add all the characters then the answer can overflow the limit of k or the answer can also underflow the limit of k. Hence if this is the case then answer is -1. Else build the solution of K length string first then add remaining or how ever you want to build your string. My sol

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Simple greedy case for -1 abs(c0-c1)>k or max(c1,c0)< k Else if c1>c0 then first k element is 1 then 01010.. 000 If c0>c1 vice versa

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

This is my wrong ans for E Wrong Sol. and i just corrected it to max(n, m) < k then also no answer and it passed :) Correct Solution. I now want to cry more hard.

  • »
    »
    39 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    E is stand for Evil, I add k > max(n, m) -> -1 then accepted... (same mistake as you)

    Silly indeed.

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Skibidi

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

guys, can you help me? I solve c2 with binary search and greedy algorithm, but i got wrong answer. I go through each element from 1 to n and find with binary search the best j element of b array, for which b[j] — a[i] >= a[i-1] and where difference between a[i] and a[i-1] smallest. What is my mistake?

void func() {
	ll n, m;
	cin >> n >> m;
	vector<ll> a(n), b(m);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (ll i = 0; i < m; i++) {
		cin >> b[i];
	}
	sort(b.begin(), b.end());
	if (b[0] - a[0] < a[0]) {
		a[0] = b[0] - a[0];
	}
	for (ll i = 1; i < n; i++) {
		ll l = 0, r = m;
		while (l < r) {
			ll m = (l + r) / 2;
			if (b[m] - a[i] < a[i - 1]) {
				l = m + 1;
			}
			else {
				r = m;
			}
		}
		if (l < m) {
			a[i] = b[l] - a[i];
		}
		if (a[i] < a[i - 1]) {
			cout << "NO\n";
			return;
		}
	}
 
	cout << "YES\n";
}
  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i feel like the problem is with 'm', you overwrite m (the size of b) with m (the middle of binary search)

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Not sure, but consider that maybe you are taking a b[l]-a[i] larger than a[i] and a[i] also works and its better.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks for the help, the problem turned out to be that I denoted the size of the array b and the middle of the binary search for the same variable, spending 2 hours searching for this error.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i would recommend learning about lower_bound() and upper_bound() in stl, it helps a lot not having to write binary search everytime. Although you should understand it well anyway.

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

what is the prove that sorting the arrays by the sum of its elements in descending order is the right answer for problem D ?

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    just do a dry run on test cases 3 and 4 you will notice that sorting the arrays by the sum of its elements in descending order actually gives the right answer. so I implement according to it which provides me with the correct answer.

  • »
    »
    40 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it


    suppose after sorting arrays:- A1, A2, A3, A4.. from A1 we get Sum{prefixSum(A1)} from A2 we get Sum{prefixSum(A2)} + Sum{A2}*2*c . . we can see that only Sum{prefixSum} is common and as we get to jth array, multiplier to total sum is j. (c is constant for simplicity)
  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    let's say one of a arrays is $$$[a, b, c, d]$$$

    now, no matter where is array is concatenated it will be multiplied by some factor say $$$x$$$ in this format => $$$x*a + (x-1)*b + (x-2)*c + (x-3)*d$$$

    which evaluates to

    $$$(a+b+c+d)*x - 0*a - 1*b - 2*c - 3*d$$$

    we just have to choose the best possible values of $$$[a,b,c,d...]$$$ for some arbitrary $$$x$$$ which maximizes this sum, if we choose $$$x = m$$$ and calculate two terms first = $$$a+b+c+d$$$ and second = $$$-0*a - 1*b - 2*c - 3*d$$$ then sorting all arrays with respect to their first and second by following the rule that first should be in descending order and second should also be in descending order then we can get the best ordering of the arrays.

»
40 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

so the authors really said "let the brain rot spread"? xD

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

please upload the editorial

»
40 hours ago, # |
  Vote: I like it -19 Vote: I do not like it

Really? You decide to use terms like "amogus", "skibidi", "ohio", "rizz" in the problems? Reading the problem statements was a terrible experience for this division.

»
40 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

Brainrot reached codeforces

»
40 hours ago, # |
  Vote: I like it +3 Vote: I do not like it

So I will admit that I thought of too many complicated ways on C1 and it consumes too much time. But then trying to simplify my observation to be just keep finding the minimum/maximum that I can take, the problem has a nice solution.

People might not like it, but I do like it as a problem, even if I struggled with it.

»
40 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

For C2 I tried picking the best element from B (the closest one to the previous in A, to keep the array non-decreasing) using lower_bound(), but I keep getting WA >_< https://codeforces.net/contest/2065/submission/305342062

I see many of you did binary search, I tried binary search as well but still got WA, how did you do it?

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    if (it != b.end() and (*it) - x >= a[i - 1])
                a[i] = (*it) - x;
    

    Since lb — a[i] is always > a[i — 1] if it is found, you always assign it to a[i]. However, there could be cases where a[i] < lb — a[i] and still satisfies a[i] >= a[i — 1]. e.g. 1 2 4 5 with b = 7. your code would output NO as it would set 2 to 7 — 2 = 5 and end up with 1 5 4 5, but you can see that is already none-decreasing!

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    https://codeforces.net/contest/2065/submission/305351820

    i have updated the code with a variable to track the last element of A and the main logic is to make the A[i] as small as possible based on the value of A[i-1]

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

this round was real skibiforces

»
40 hours ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Hi CF Community! I have a question about problem D in this contest.

assume that the first massive is a[0]

so let's count the number of appereances in final answer of each element in a[0]

a[0][0] => n * m

a[0][1] => n * m — 1 ....

and let's put two the second one a[1] and count the numner of appereances

a[1][0] => n * m — m a[1][1] => n * m — m — 1

.....

so shouldn't we sort by sum of a[i][j] * (n*m-j)

can someone tell me why that's wrong logic

»
40 hours ago, # |
  Vote: I like it +8 Vote: I do not like it

Hello, could someone please tell me when Codeforces typically runs the plagiarism check? For example, how many days after a contest does it occur? Also, for round 1002 div 2 , have the plagiarism checks (and the process of skipping certain solutions) been completed, or are they still pending?

  • »
    »
    39 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    looks like someone cheated and is scared now

    • »
      »
      »
      39 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      bro if you know you can help don't do these things

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

do ratings only come out after hacking?

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

can anyone tell me in C2 why

  1. a[0] = b[0] — a[0] works but
  2. a[0] = b[m-1] — a[0] do not ?

I got wrong answer for second condition on 7302rd answer !!!

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    a[0] is the starting value of the non-decreasing array. It's always useful to minimize a[0] -> choose the smallest b[j] element

  • »
    »
    40 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    well your aim is to make ai smaller as you can and b[0] — a[0] <= b[m- 1] — a[0]? if you don't see this you can reason about it as follow: b[0] <= b[m — 1] ( assuming they are sorted) then b[0] — a[0] <= b[m — 1] — a[0] so its optimal to pick b[0] and btw thats why you pick smallest b that saitisfy bj — ai >= ai-1 for every other element

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Would somebody be so kind and explain the formulars for 2065G - Skibidus and Capping

How the primes and primefactors have to be considered? I dont get it from the codes. Thanks!

  • »
    »
    40 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    A semi-prime number can be made in one of the following ways using $$$(p,q)$$$; wlog $$$p >= q$$$.

    1. $$$lcm(p,q) = p*q$$$; where $$$p$$$ and $$$q$$$ are prime and $$$p\neq q$$$

    2. $$$lcm(p,q) = p$$$; where $$$p$$$ is a semi-prime and $$$q|p$$$

    Submission: 305353694

    EDIT: Updated submission link with comments

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Apologies but after reading the comments above i still cant figure out why my submission on C1 doesn't work.305350489

can some one pls help

  • »
    »
    39 hours ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    you are only using the operation when a[i-1]>a[i]. but you need to make the array as small as possible. like even if the first element is smaller than the second element you need to check if you can make it more smaller using the operation. if you can you have to otherwise proceed to the next element. (this is because there maybe cases such that due to not making the initial elements smaller at one point even after applying the operation on the current index you can not make the array sorted which you could if you had made the initial elements smaller)

»
40 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

l

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

How the heck is this contest div4? C1 was like a nightmare

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

brainrotforces

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

cry always makes me cry !

»
40 hours ago, # |
  Vote: I like it +12 Vote: I do not like it

GPT solved Round 1003 H (https://codeforces.net/contest/2065/problem/H).

I am sharing this code in the hope that it will help in detecting cheaters.

This is my ChatGPT log.

https://chatgpt.com/c/67a8d934-fa04-8005-bd69-36dd034fc7e1

My query was just only 2 steps.

1) copy & paste the whole context of the problem, and add one sentence.

I added by korean : 이거 조합론 문제같은데 어떤 아이디어가 좋을까?

In english it means : It looks like a combinations problems. Which Idea may be best?

2) GPT found all observations. (How to count the answer, How make the Solution efficiently from O(n^2) to O(nlogn) ) So I gave GPT my template code and just said, "Can you implement your code in this template?"

And GPT's Answer got AC. (AC code : https://codeforces.net/contest/2065/submission/305350099)

To avoid causing confusion on the scoreboard, I submitted the code after the competition ended. However, I was able to obtain this code before the competition ended and did not modify a single character.

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Same, but I didn't need to give it the second query. I just copy-pasted the statement and it provided the AC solution.

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Proof_by_QED , @cry could someone please tell me when Codeforces typically runs the plagiarism check? For example, how many days after a contest does it occur? Also, for round 1002 div 2 , have the plagiarism checks (and the process of skipping certain solutions) been completed, or are they still pending?

»
40 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

unfortunately i misread c1 and it took extra 25 min sad...

  • »
    »
    40 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    hey can you answer my above doubt

    • »
      »
      »
      39 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It generally takes 2–3 days for them to send a warning to the person for the first time. Two of my friends, in their initial days on Codeforces, were not aware of plagiarism, so they solved a problem together and submitted the same code. After 2–3 days, they received warnings and for one the problem was skipped.

      i think upto 1-2 week max it take not sure...........

»
40 hours ago, # |
  Vote: I like it +4 Vote: I do not like it

Amazing Contest. Problems were fun to solve.

»
39 hours ago, # |
  Vote: I like it +10 Vote: I do not like it

In problem E what is the point of writing max(x − y, y − x) instead of abs(x — y)?

»
39 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

c1==========>chutya

»
39 hours ago, # |
  Vote: I like it +11 Vote: I do not like it

C1 and C2 completely ruined my contest... its sad because D and E are such nice problems too (and easier than C1 and C2 imo), many people (like me) did not even get to try E during the contest due to overthinking C1 itself... question order could've definitely been better :/

  • »
    »
    24 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    True man, I also solved c2 in the last minute, no time to even read D or E. This contest was a brainstorming one.

»
39 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Nice Contest! Made some mistakes, brain was not braining in C! But good problems. Enjoyed F the most.

»
39 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

if we hacked someone's problem! what we will get in return>>??

»
38 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

I am trying problem c2 but i am getting WA for a test case.Can anyone tell me which it could be?

Here is my submission: 305359434

  • »
    »
    38 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i dont know but it seems like you did not handle the case where a[i] could be optimal instead of b[j]-a[i]. did you handle this case ?

    • »
      »
      »
      38 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Pardon me.what do mean by optimal here ?

      • »
        »
        »
        »
        38 hours ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        sorry you have handled that case but the thing is you are updating j. but actually any value of b can be used here any no of times.

        i think your logic is correct just you need to think of taking the optimal value of b every time

        • »
          »
          »
          »
          »
          38 hours ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          But let say a[0] < a[1] and i took the b[0] — a[0] value as a[0]. then if again take b[0] — a[1] as a[1] then it will make b[0]-a[0] < b[0] -a[1] which makes a[0] > a[1].thats why i did not consider previous value . it will make b[j]-a[i] more smaller.

          • »
            »
            »
            »
            »
            »
            38 hours ago, # ^ |
            Rev. 3   Vote: I like it 0 Vote: I do not like it

            the thing is we always want this : a[i-1] <= b[j]-a[i] right? or we can say a[i-1] + a[i] <= b[j]. so now you need to find such b[j] for which this condition holds and this b[j] should be the closest to a[i-1]+a[i], after you find such a b[j] then you need to check whether now b[j]-a[i] is better or a[i] itself. if a[i] is better it will remain a[i] other wise it will change. also you need to check before this if a[i] >= a[i-1] . if this happens only then you will check which value from b[j] -a[i] and a[i] itself is better. so you can see that same b[j] can be optimal for multiple a[i] because we are just playing with addition and subtraction here.

            suppose b = {1 , 2 , 3 , 7 , 10} and a[i-1]+a[i] = 6 also for the next pair a[i]+a[i+1]= 7 . for both these cases you have to chose 7 as your b[j]

        • »
          »
          »
          »
          »
          38 hours ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Could you tell me what do you mean by optimal value of b here ?:)

»
37 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

Div 3.5

»
37 hours ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

is it me or does problem D statement seem confusing? I understand that it says "concatenate them in any order to form a single array" but one might assume that we cannot change the order of elements inside each individual array and can only concatenate them as blocks in any order especially given the fact that they give a clarification on the array concatenations The concatenation of two arrays c and d with lengths e and f respectively (i.e. c+d) is c1,c2,…,ce,d1,d2,…df . It turns out I've spend a lot of time trying to solve a different problem and then i read the editorial and feel silly now Sort each array in decreasing order. Sort the arrays themselves in terms of their sum, from largest sum to smallest Put together the final array Take the score This score is guaranteed to be maximal.

»
36 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

As a newbie, I want to say that for a test solving team consisting of only expert+, the problems came out pretty well. Really liked the round. Also, appreciate the design choice of making C2 such that C2 code works without change for C1 -- attempting C2 first made me completely bypass the C1 troubles people seemed to be having.

»
34 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

The rules require participating in at least 5 rated rounds, and this is my 5th round. Will it be counted?

»
26 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

why rating late this time. Anyone answer

»
26 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

A newcomer question: I participate in the contest and got some of the problems solved. Why my "contest" shows it only under "unrated"? Does it mean the rounds div4 r all unrated contests. Do I need to take part in at least 4 other div4 (or higher) rounds to got my rating.

  • »
    »
    25 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if you participated as a rated contest (this option comes when you register for a div4 , div3 and edu div2 most probably) then you will get your rating once the ratings are given. the ratings are not published yet

»
26 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

how much time it will take after final standings

»
24 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

One of the best div-4 contest of Codeforces. Problem statements were easy, but the problems were nightmare. Pretty much unsolvable for AI. A complete brainstorming round indeed.

»
22 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Good contest

»
20 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

How long does it take to update ratings?

»
19 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

For problem H, you should say you sum over b with multiplicity. E.g., despite 0,1,00,01,001 being the only subsequences of 001, we sum over 0 twice and over 01 twice.

»
19 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
can anyone tell please tell , what the hell happend to my code(wrong on test 2)
Skibidus and Fanum Tax (hard version)

305469004 [problem:C2 — Skibidus and Fanum Tax (hard version)] oid solve(int t) { int n, m; cin >> n >> m;

vi v(n), p(m);

FOR(i, n) cin >> v[i];
FOR(i, m) cin >> p[i];

sort(all(p));

if (is_sorted(all(v))) {
    cout << "YES" << endl;
    return;
}

int first = min(v[0], p[0] - v[0]);

for (int i = 1; i < n; i++) {



         int l = 0, r = m - 1, res = -1;

    while (l <= r) {
        int mid = l + (r - l) / 2;
        int op = p[mid] - v[i];

        if (op >= first) {
            res = mid; 
            r = mid - 1; 
        } else {
            l = mid + 1; 
        }
    }

    if(res!=-1){

        if(first <= v[i] && first <=p[res]-v[i])
        {
             v[i]=min(v[i],p[res]-v[i]); 
        }

    }

   if(v[i] < first)
   {
        cout<<"NO"<<endl;
        return;
   }

  first=v[i];



}

cout<<"YES"<<endl;

}

  • »
    »
    16 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    When res!=-1 and v[i] is invalid (first > v[i]), there one possible solution p[res]-v[i] that should be used instead, I think this part should be modified likewise:

      if(res!=-1){
            if(first <= v[i]){
                v[i]=min(v[i],p[res]-v[i]); 
            }else {
                v[i]=p[res]-v[i];
            }
        }
    
»
18 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Has the rating been updated? The competition is shown as unrated in the profile.

»
16 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

when will rating change?

  • »
    »
    16 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Probably it will be updated within 36 hours

»
16 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Why ratings are not updated yet.

»
15 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

When will be the rating gets updated of this contest?

»
15 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

cry Proof_by_QED chromate00 larush Edeeva I think you guys should add combinatorics tag for problem G. I just upsolved it and it used a lot of combinatorics ideas like double counting, number of ways to choose etc

»
4 hours ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

https://codeforces.net/contest/2065/submission/305551593

For C2:

Can anyone explain what I'm doing wrong/give a tc that my code would fail?


#include <bits/stdc++.h> using namespace std; using ll = long long; void solve() { int tc; cin >> tc; while (tc--) { int n, m; cin >> n >> m; vector<ll> a; for (int i = 0; i < n; ++i) { ll x; cin >> x; a.push_back(x); } set<ll> b; for (int i = 0; i < m; ++i) { ll x; cin >> x; b.insert(x); } ll min = *b.begin(); for (int i = 0; i < n ; ++i) { if (i != 0 && *b.lower_bound(a[i] + a[i - 1]) >= a[i] + a[i - 1]) { if (i == n - 1 && a[i] < a[i - 1]) { a[i] = *b.lower_bound(a[i] + a[i - 1]) - a[i]; } else if (i < n- 1 && *b.lower_bound(a[i] + a[i - 1]) - a[i] < a[i]) { a[i] = *b.lower_bound(a[i] + a[i - 1]) - a[i]; } } if (i == 0 && min - a[i] < a[i]) { a[i] = min - a[i]; } } if (is_sorted(a.begin(), a.end())) { cout << "YES\n"; } else { cout << "NO\n"; } } }
»
13 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

I need help to understand why my solution doesn't work for C1, please help me to understand the flaw in my code.

Intuition: I thought of a greedy approach where I will start moving from the end of the array and move toward the front of it, while moving forward I will maximize the training element.

#include <bits/stdc++.h>
#define int long long int
using namespace std;
void solve()
{
    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    for (auto &it : a)
    {
        cin >> it;
    }

    vector<int> b(m);
    for (auto &it : b)
    {
        cin >> it;
    }

    if (is_sorted(a.begin(), a.end()))
    {
        cout << "YES" << endl;
        return;
    }
    a[n - 1] = max(a[n - 1], b[0] - a[n - 1]);
    for (int i = n - 2; i >= 0; i--)
    {
        if (a[i + 1] < a[i])
        {
            a[i] = min(b[0] - a[i], a[i]);
        }
    }

    if (is_sorted(a.begin(), a.end()))
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
int32_t main()
{
    int tc = 1;
    cin >> tc;
    while (tc--)
    {
        solve();
    }
    return 0;
}

Please help me with this bug, I am unable to understand the problem.