Help me with the error

editorial
salary

#1

I am getting correct ans for my test case. But codechef compiler is giving time sigtstp error.

`

int T,N,moves,minW;
long sum = 0;
cin >> T;

for(int t=0; t<T; t++)
{
    cin >> N;
    vector<int> W(N);
    
    for(int i=0; i<N; i++)
        {
            cin >> W*;
            sum += W*;
        }
    
    minW = *min_element(W.begin(),W.end());
    
    moves= sum -N*minW;
    cout <<moves << endl;
}

return 0;

}
`


#2

Did you make a submission or just ran it on the Codechef IDE? I assume you ran it on Codechef IDE.

Near the run button, you’ll see a box called Custom Input. Click on it, and in the space that appears, paste the sample test case. Now hit Run. It will no longer give you the error.

Feel free to ask if anything is unclear. Hope this was helpful :slight_smile:


#3

I ran the custom Input and there was no error in Codechef IDE. But when I tried to submit the solution, then the error came.