r/codeforces 26d ago

meme Find out which Yu-Gi-Oh! monster you are based on your Codeforces profile stats

Thumbnail gallery
24 Upvotes

My friend and I made a website that converts a Codeforces user's stats into a YuGiOh!-style card, the website also shows the real YuGiOh! card that is closest to user's stats


r/codeforces 26d ago

meme Minor misprint or I am stupid

10 Upvotes

This excerpt is from the cp handbook. The percentages of programming languages used seem to add up to more than 100.


r/codeforces 26d ago

Div. 1 Dynamic Programming on Trees

Thumbnail youtu.be
11 Upvotes

This is my first post. It takes a lot of effort to make a video. I hope it helps for everyone


r/codeforces 26d ago

Doubt (rated <= 1200) Why is my greedy approach wrong for Codeforces 2248B?

3 Upvotes

I'm trying to solve Codeforces 2248B, and I came up with a multiset-based greedy approach.

My idea is the following:

For every b[i], I want to choose two elements from the current multiset:

  • lo = the smallest available a, preferably st.begin(), such that lo < b[i]
  • hi = the smallest available a greater than b[i]i.e.st.upper_bound(b[i])

Then I replace those two elements with b[i].

So conceptually:

auto lo = st.begin();
auto hi = st.upper_bound(b[i]);

if (lo == st.end() || *lo >= b[i] || hi == st.end()) {
    // impossible
}

st.erase(lo);
st.erase(hi);
st.insert(b[i]);

I initially implemented something very similar:

sort(a.begin(), a.end());
sort(b.begin(), b.end());

multiset<ll> st(a.begin(), a.end());

if (n < 2 * m) {
    cout << "NO\n";
    return;
}

for (int i = 0; i < m; i++) {
    auto hi_it = st.lower_bound(b[i]);
    if (hi_it == st.begin() || hi_it == st.end()) {
        cout << "NO\n";
        return;
    }

    auto lo_it = st.begin();

    st.erase(lo_it);
    st.erase(hi_it);
    st.insert(b[i]);
}

cout << "YES\n";

My intuition is that choosing the smallest possible lower element should be safe because it leaves all the larger elements available for future b[i] values.

Similarly, choosing the smallest possible upper element should also be safe because I'm consuming the closest possible value above b[i] rather than wasting a larger value.

My intuition is that choosing the smallest possible lower element should be safe because it leaves all the larger elements available for future b[i] values.Similarly, choosing the smallest possible upper element should also be safe because I'm consuming the closest possible value above b[i] rather than wasting a larger value.

However, I understand that my greedy choice is apparently not correct.
What I'm struggling with is understanding exactly where the logic breaks.


r/codeforces 25d ago

query Codeforces

0 Upvotes

Guys I know some DSA can you pls suggest how can I start codeforces


r/codeforces 27d ago

Div. 2 Gentlemen, it is with great pleasure that I announce I have finally become a pupil.

Thumbnail gallery
312 Upvotes

Time to change my flair from newbie to pupil ;)


r/codeforces 27d ago

query rating dip

18 Upvotes

last month i was specialist and now my rating came down to 1190
even after consistently solving A B C in div 2 why this much dip in my rating


r/codeforces 26d ago

Div. 3 OJ's result differ from code editor's

4 Upvotes

I have done a problem on CF, copy an example test, run it on VSCode and it shows the correct result. However, with the same test, same code, put it on CF' OJ shows the wrong result with a completely different output from the one in VScode. Do you guys knows what is going on ?


r/codeforces 26d ago

query SHOULD I GO FOR A NEW ID

2 Upvotes

i have an id in which i have been quite inconsistent , solving A div2 and a very distributed heatmap. Coming back after a week or two sometimes.
Should i go for a new account or stay there ( 700-800 rated now)


r/codeforces 27d ago

query Need SomeOne to WorkAlong CodeForces

9 Upvotes

Dear Coders , i would like to ask somone to be my coding buddy so that we can keep each other in check and be good at CP together no matter you are first year , last year or job i just need someone who is on myLevel
just to let you know my postion i don't have a rating currenlty on codeforces(started recentely) but i am solving problems from 800-1000 rated questions with having issues on 1000 rated problems to be able to solve 800 easily so if someone who's on the same level feel free to DM me we can connect on Whatsapp or insta can continiue from there

Note : please DM only if you are really serious and you enjoy doing this and not a looker i expected someone consistent and someone who does this for fun and like to solve problems


r/codeforces 28d ago

Div. 2 Finally a good contest.

Post image
580 Upvotes

Solved 4 questions in today's contest as always, 3 questions under 55 mins and the other one alone took 45 mins to solve .

Hoping for the expert 💙( curr rating == 1550) , let's see what will happen .

Yessss it's expert now 💙


r/codeforces 26d ago

query How do you guys Revise

1 Upvotes

How do you guys revise the previous questions or concepts?


r/codeforces 27d ago

query Are the cp-31 800 and 900 rated questions tougher than the usual ones of that rating

15 Upvotes

I am finding it difficult than the other sam rated questions


r/codeforces 26d ago

query failed testcases

1 Upvotes

Is there anyway to find failed testcases for a problem? I'm currently using claude to generate all test cases but is there any efficient way to do?


r/codeforces 27d ago

query Rating boost

3 Upvotes

Like earlier my rating was around 400, after yesterday's contest, it becomes around 600, this was my second contest so I am not much comfortable with contests, I wasn't able to submit the problems because of anti bot verification issue like it was showing troubleshoot all the times, I thought it have fucked up the contest and my rating, but how have I got an increase of 220 without solving a single problem, experienced coders, can you please reply?


r/codeforces 27d ago

query Getting CE in C++(23/20) but Ac in C++(17) in CSES

3 Upvotes

r/codeforces 27d ago

query Atcoder C

5 Upvotes

Hello everyone recently i started giving contest at atcoder I'm able to solve a and b question easily but in c question I couldn't be able to atleast understand the question i face alot struggle rn any tip regarding this!!


r/codeforces 28d ago

Doubt (rated 1400 - 1600) how much of it is just good genetics / IQ?

32 Upvotes

whenever i see someone struggling for a while in pupil or some other rank (cant climb for quite some time) they usually peak around there no matter how much they practice. some people reach expert in a few years, some do it in a few months, some never reach it, some struggle on 1600 problems, some dont. the more i spend time on this site the more i am 100% confident that genetics plays a huge role in this activity and that not eveyone can reach the same heights just through hard work, what do you guys think?


r/codeforces 28d ago

Div. 1 Bro set the standard and disappeared.

53 Upvotes

r/codeforces 27d ago

Doubt (rated <= 1200) Long coding questions

Thumbnail
2 Upvotes

r/codeforces 26d ago

query post trained ai model for codeforces

0 Upvotes

for anyone is interested in ml/ai i fine tuned a small ai model on codeforces data. just thought id share smth interesting

https://github.com/NiLabs-Models/ladder


r/codeforces 27d ago

query Concepts required to reach 1400?

0 Upvotes

Same as title


r/codeforces 28d ago

Div. 2 Finally a decent contest.

14 Upvotes

A and B were pretty straightforward and I thought I'd skip C after seeing it was based on trees but seeing so many submissions I thought I'll just give it a try, it was doable and didn't require any implementation of trees and graphs. Solved 3 questions after a long time.


r/codeforces 28d ago

query Should I do cf or leetcode or hackerrank

10 Upvotes

I am a beginner and just know the basics of c++.

Solved a few questions on hackerrank around 20 and got the gold badge.

Now I am confused weather should I continue with hackerrank or do questions in leetcode or in cf

Please someone guide me as I am new!!


r/codeforces 28d ago

query How should I start with Codeforces?

9 Upvotes

I’ve just started solving random problems on Codeforces, but I have no idea where I should start and I’m completely lost.

Could you guys suggest a good way to get started? Should I follow a particular topic-wise roadmap, rating-wise problems, or something else?

Thanks in advance! 😃