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

Автор rgrg4, история, 5 лет назад, По-английски

Sometimes we have a good contest while in others we don't perform well. Just to lift your mood can you people share some funny incidents that happened with you during your competitive programming journey

  • Проголосовать: нравится
  • +173
  • Проголосовать: не нравится

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

Codeforces Round 694 (Div. 1)

I submitted B at 00:25 (103410744), pretests passed, 1998/2000 ms.

At 00:30, I decided to replace all long long with int and I resubmitted, TLE on pretest 3.

I moved to C, I got pretests passed at 01:33.

I checked the standings. It turned out that D was much easier than C, and it was worth 500 more points. I was unable to solve it in the remaining time.

I failed system tests on B (TLE on test 7).

After system tests, I resubmitted B with int, still TLE on test 3.

A moment later, I realized that there's $$$w \leq 10^{18}$$$ in the input ($$$w$$$ was quite a useless variable, since every query with $$$w \geq 1$$$ had the same answer regardless of the value of $$$w$$$).

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

I got a wrong answer in contest only because i forgot to remove cout << "hi" 99846875

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

I once spent an hour figuring out what was giving me WA. Turns out I had written a-=min(a,b); b-=min(a,b) ignoring that value of a was getting changed in my code. Lesson learnt!! :weep:

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

Once I wrote #pragma GCC optimize("Ofast,untroll-loops").

The trolls are definitely gone.

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

In codeforces round #698 I submitted 5 wrong answers for B. My first submission was at 00:31 and my Accepted solution at 1:14(with a minus of 250 points for Wrong Answers). The example test case had the value of d(which was the input) as 7. So while writing my code instead of using d I used 7 everywhere instead. All my example testcases passed because of this but got WA at testcase 2. It took my half an hour to realize that I needed to replace 7 with d. Here is my incorrect solution — 105742575

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

#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

In a contest i wrote IOS after cin>>t . My code was working fine locally but was giving wrong answer on some pretest. I moved IOS before cin>>t and it worked . Does someone know why it was actually causing the error ?

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

100954176 I put a break before reading the entire input in a multitest problem. It took me half an hour after the contest to realize the mistake.

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

In round 689, I got WA on a problem because of forgetting to print a newline in one of answers of the edge cases. 100942496

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

This happens quite often with me. I solve a question with answer as "YES" or "NO". It works fine on my system, giving all the answers correctly. But when I upload it, I get wrong answer. I spend a lot of time figuring out what is wrong with my algorithm, change my code in varied ways, only to realize at the end that the problem was with the way I printed yes and no.

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

Seeing poor performance at my end, I left a contest midway to do otherwise unimportant work. When I resumed after returning, I failed to submit E due to the shortage of a few seconds. Sed Lyf

Thankfully this only happened during a virtual contest xP Lesson Learnt!

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

In Codeforces Round 594 (Div. 2), I forgot to use long long in both the div2A (62980149) and the div2B (62990647), went grey because of that D:

Also my solution for Good Bye 2020 E passed in 1996ms for a 2000ms TL, the same code passed in 600ms using C++17 (64)

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

Umm... before educational round 103, I made some changes in my template or better say I changed

#define ll long long int

to

#define ll int

I ended up making 10 wrong submissions for problem B and realised the mistake after checking my template.

P.S. Don't code while you are drunk.

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

I solved only one Question in last educational round and that too someone hacked.

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

I submitted B in place of C and lost points... :P

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

When I was participating in the first contest of my life, I didn't know that the difficulties increase so much, so when I couldn't solve the easier problems, I opened F thinking that maybe it would be easier than the previous problems. But obviously, I didn't even understand the statement.

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится
  1. if(a>b)?cout<<"Yes":cout<<"No";
  2. int i,j,n,m; for(i=0;i<n;i++) { for(j=0;j<n;j++) { } for(i=0;i<m;i++} { } } Figuring out why program is running for so long time(infinite).
»
5 лет назад, скрыть # |
 
Проголосовать: нравится -20 Проголосовать: не нравится

Replacing endl with "\n" got me from TLE to AC.

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

I once wrote for (int i = 1 ; i <= n ; n++) and it took me 30 minutes to debug

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

I once wrote #define ing long long in my school's contest and spent 30 minutes trying to figure out why I got Wrong answer on test 3.

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

During a contest, I attempted at solving problem E because it felt easier than a usual E. I didn't realize that I was trying E and submitting on D :( I didn't realize it even after the contest ended and was trying really hard to debug and find what's wrong. 1-gon Monogorz helped me find the bug :clownglasses: :ghosthug:

Untitled

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

I got a tle in one solution because I was using long long int instead of int

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

Rookie here. In my first div 3 contest, I happily solved problems A and B and submitted the code at around 00:15 but got CE. Spent 40 mins trying to find the bug but still failed. Turns out that I selected the wrong language. Dang.

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

I once implemented two segment trees to find minimum and maximum element in the range related problem of the array. It was a sorted array (-_-)

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

1) Once, I had pretests fail just because I forgot to print "new line" on a corner case.

2) Once, I had pretests fail on a 1900 level problem (hardest in-contest problem) just becuase I forgot the case of 1.

3) Once, I had system-tests fail because I forgot to return m on a corner case.

4) Once, I had system-tests fail because of long long issues.

5) In the most recent contest, I spent 3 minutes of A, 30 minutes (ish) trying to solve B, then looked at C & solved it. After solving C, I finally figured out how to solve B, but I ran out of time. It turns out my A solution was hacked because of some dumb errors, so in teh most recent contest, I only solved question C.

6) Once, I accidently submitted problem D to the problem C slot, hence making me lose 50 more delta than before.

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

My solution got hacked because I used ceil(). Though, I learnt a lesson that I won't do this mistake in future.

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

Once I was returning the answer even before taking the whole input....RIP

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

In vector I made assigned values like v[i] = a, instead of v.push_back(a) in D problem. This was the only mistake in my solution during contest.

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

found this once Codeforces Dual

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

Once I got wrong answer on test case 149.I thought that I may be missing some edge case. But eventually it turned out that my whole logic was wrong but still it was able to pass 148 test cases.

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

Once i got wrong answer just because i have printed "N0" instead of "NO" . https://mirror.codeforces.com/contest/1388/submission/88469165

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

In a contest, I failed a system test just because my code was printing 1e12 instead of 1000000000000 :\ sed lyf...

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

Codeforces Round #470. It's my first contest, I'm getting ready, I've been solving problems for a year now and I'm ready to get these problems solved. The contest started and I have no clue why the problems are that hard. I've read A, B and C and didn't have any idea so I moved to problem D and I thought I can solve this one.

One and half and hour has passed and I finished the code but I couldn't submit because I didn't register to the contest. Oh god, I'm in Div.1! I moved to Div.2 so quickly and solved problem A and started finding problem D in the Div.1, which was problem E in the Div.2, I got a wrong answer (obviously) and A didn't passed system testing. My university's coaches laugh at me until now, although my code had a bug and I solved it after the contest.

Don't code problem D Div.1 when you can't solve A Div.2.

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

In 2018, during the last phase of the Brazilian OI, I forgot to put the '\n' in one of my printfs in a segment tree problem, I tested the cases and everything seemed fine, because it hadn't reach the if that contained the bad printf. The contest was blind, so I ended with 0 points on that problem, thus not reaching the Team Selection Phase for IOI.

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

This took my whole morning : D

for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++i)
        do_something_with(i, j);
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

In the cf edu round 103 for problem B i wrote a correct code within 15 mins but I overwrote it on solution of A and wasted like more than 25 mins to find the bug. I had written the code for A in test_case() function but for B i wrote in precompute() function without erasing solution of A. Lol.

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

    Just a tip if you (or someone else) uses vim, you can use :u0 to restore the file to it's initial state at the time of opening. You can do that and start doing the next problem with a clean slate.

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

once I used the same iterator variable inside a nested nogic, almost went mad debugging!

for (int i = 0; i < n; ++i){
    for (int j = 0; j < m; ++j){
        // somestuff
    }
     //again somestuff
    for(int i = 0; i < k; ++i){  // here I again used i as the for loop iterator
          
    }
}
»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I secured 179 rank in CF round #692. Particularly because I did B problem very quickly. But when my friend asked me about the reason I used brute force to solve it, I was dumb and just said strong intuition made me write a brute force.

A few contests later, I secure 6086 rank in CF round #698, where I couldn't solve the B problem. But ironically, the way my friend solved the same problem was strong intuition and brute force only and he was unable to state a proof to it xD. The same condition like a recent problem but roles switched!

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

Submitted in the wrong problem and got "Wrong Answer on Pretest 2".

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

Well this happened to me in some atcoder ABC a while back...I had to print Takahashi in some problem as answer but I was printing Takashi. Costed me some reasonable amount of time :(

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

Once I've wrote two different ok solutions for this 987E - Petr and Permutations problem only to realize I was misspelling Um_nik with Um_Nik. Always read the statements!

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

I did an oopsie in Codeforces round #700 div2/B. Instead of "<=" I used "<" and pretests were passed during the live contest but gave WA after system testing. Sed lyf I guess :(

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

I started Quora Programming Contest Div 2 (actually it is just round 2) late by 50 minutes. I thought it started at 10 am local time when it is actually 9 am.

In the last few minutes I was fine-tuning some weights for an ML task and luckily got into top 50 for the shirt.

I learnt to never give up :P