"I want to ask a question" - Ask them all here!

I have implemented a sieve of eratosthenes code with O(N) time complexity. I am getting a SIGABRT error.
terminate called after throwing an instance of ‘std::bad_alloc’
what(): std::bad_alloc

1.What is a SIGABRT error?

  1. What is the error made here?

  2. Suggest resources for learning C++ for Competitive coding. I know C and Java.

    #include <bits/stdc++.h>
    using namespace std;

     const long long MAX_SIZE = 1000000001;
     
     vector <long long >prime;
     vector <long long>isprime(MAX_SIZE,true);
     vector<long long>SPF(MAX_SIZE);
     void seive(int n){
         isprime[0]=false;
         isprime[1]=false;
         for(long i=2;i<n;i++){
             if(isprime[i]){
                 prime.push_back(i);
                 SPF[i]=i;
             }
             for(long j=0;i*prime[j]<n && j<(int)prime.size() && prime[j]<=SPF[i];j++){
                 isprime[i*prime[j]]=false;
                 SPF[i*prime[j]]=prime[j];
             }
             
         }
     }
     int main() {
         int t;
         scanf("%d",&t);
         seive(10000000);
         for(int i=0;i<prime.size();i++)
         printf("%d\n",prime[i]);
         return 0;
     }
    

Thank You

Wrong Editorial link
Hey @vijju123, @admin,
The editorial link for the problem BWCELL, CodeChef: Practical coding for everyone and BWCELL Problem - CodeChef is wrong. It should be BWCELL - Editorial - editorial - CodeChef Discuss .

@vijju123 please help

I have recently signed up on codechef(1 week around) and I have secured 4th rank in Schools in India.But unfortunately, my school is not listed on Codechef so I want to know that if I am eligible for laddus of this contest or not.

I would also request @admin to add my school to list asap and I am all ready to help them in this regard.

Here is the link to my school official website.

In the December Lunchtime yesterday, I looked in the ranklist after solving two problems and to my surprise I was ranked 11’th overall with 200 points. (I saved a screenshot! haha).

Then a few minutes later I looked at the ranklist again and my rank was down to 100, but there were now many more people ranked higher than me who also had only 200 points.

Was this a glitch or some kind of timing issue? The contest said “IOI Scoring rules” which said ties were broken by shortest time to reaching a particular score. So if at one time I had rank 11 with score 200, how could I later be ranked lower than people who also got 200? Thanks for any explanation.

Outdated Link

Hey @vijju123, @admin,

Although it is not a big issue, but still posting.:slight_smile:
The link (when clicked on ?), wmd-editor.com on the upper-right corner of the editor is outdated, it takes to a Japanese Health Website.

PS: This link, Daring Fireball: Markdown Syntax Documentation can be used for markdown help.

1 Like

if possible please provide a counter case : runtime error! - general - CodeChef Discuss

Code chef informs that any second account of my own which is not in use should be reported. I have an account for which I forgot the username. How do i inform codechef about it?

How to find Division and remainder of no if only operators available are addition and Subtraction?? PLs Help///\

A bit confused of what a humongous subsequence exactly is.Like if we take ‘10010’ then is {1,3} also a humongous subsequence, and how is {1,5} a humongous subsequence.
For ‘10010’ humongous subsequences should be {1,2},{4,5}, but these aren’t the only ones, {1,5},{1,3} also, and what about {1,2,4,5} and {1,3,4,5}???

Hello Vijju123 , I am a new programmer so i just want some tips how to imporve my basic programming because i have a lot of problem in finding the solution(The Logic),if i understand the logic of the program then its nothing , so my main problem is how shall i decode the logic of the program , please provide me with some of your important tips so that i may also become like u . Hope u would help me.

Why is ranklist showing 0 pts for all participants for the challenge sum of this long challenge?

In INOI, CodeChef gave us the access to some test cases, but they were too large to copy paste into the ide. Can anyone tell how to run input files in terminal?

https://www.codechef.com/viewsolution/17002534

the answers on my pc are correct but I am getting wrong answer here.
Same is happening to one more question
I don’t know why

Can somebody guide where I am wrong?

Hi, I can’t submit solutions to problem BWGAME. When I tried to submit, it says,“Problem does not exist in the Practice section. You cannot make a submission to it.” How can I submit it?

Hello Vijju123, I have been recently studying my computer subject (Out Of The Blue) so i had this chapter called
Data Structure , it had a term which i cannot understand and my teacher suck at teaching so if u could do the honor’s and please explain what STACK is?!

Hello Sir will u please suggest any good source for understanding Heavy Light Decomposition i tried studying it 3,4 times on https://blog.anudeep2011.com/heavy-light-decomposition/ but can’t understand it…
Thanks

Hey guys ! i have found the best programming course of python which is TOTALLY FREE
FREE
FREE
FREE
https://www.udemy.com/mastery-python-3-basics-tutorial-series-sqlite-with-python/?couponCode=WELCOMEFB

For the RECTANGL problem out of JAN18, am I missing something? It seems as easy as checking if two unique pairs of identical numbers exist. This works in the code/compile/run with the given (and my own) test input. Am I looking at it too simple/is there an edge case?

How do we get or loose points?
i know that the description is given in rating,but i want to know in short,i don’t want to spend my time in reading the whole description,

As i have seen that many user solved 10/10 questions in jan challenge,but still they loose their points,
so , may i get to know?

Any suggestions or tips for tomorrow’s CCDSAP certification exam for newbies…so that they can perform well in exam…

*Any help will be appreciated…