CHEFHACK - Editorial

I habe a problem in my solution http://www.codechef.com/viewsolution/1745646 based on the editorial which seems to be more a compiler/c++ problem then an algorithmic problem.
I got the error “Access violation reading location 0x01A4B7A4” when trying to read from my big prime array. Can anyone help?

Please have a look at the following solution :

http://www.codechef.com/viewsolution/1746818

It gave correct results for the test cases mentioned in the editorial here, those in the problem statement and some cases generated by myself. But still it displays ‘Wrong Result’ here.

Please help!

Can you please tell whats wrong with my code…its giving correct output for test cases…

http://www.codechef.com/viewsolution/1752815

my


[1]  is giving a runtime error(NZEC).Can anyone plz tell what is the problem?


  [1]: http://www.codechef.com/viewsolution/1790006

Can anybody look at my solution and explain why am i getting Runtime error(segmentation fault). i cant see why…:frowning:

http://www.codechef.com/viewsolution/4125365

my code runs fine on my machine but shows wrong answer on submission
Please help my solution is here CodeChef: Practical coding for everyone

@anton_lunyov

@i_am_what_i_am

Hi, I just studied DFS and then searched this problem through question tags.
I passed the given test cases and also the cases given in editorial.
But still couldn’t get AC.

I made these solutions:

  1. https://www.codechef.com/viewsolution/8801554 —> It gave me WA

  2. https://www.codechef.com/viewsolution/8801563 —> It gave me RE

The only difference between both these solutions is that i have changed my counter variable which is needed to be printed from long to long long.

I would be so glad if anyone could explain me the bug.

struggling from a day with my code here
it gives correct answer to all cases ever in discussion or editorial but still getting a WA.
help would be greatly appreciated

Hey I solved the problem with same approach as given above but it’s showing wrong answer. Please can anyone help

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

Hey I solved the problem with same approach as given above but it’s showing wrong answer. Please can anyone help

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

Did you test you program at least somehow?
They produce wrong result on any possible test.
I don’t know. Consider for example this one:
1
1
3
The correct answer is 1, while you return -0 (yeah, with this crappy minus sign)

One suggestion is that you should use long long type for unsec and print it as printf("%lld ",unsec).

2 Likes

fantastic editorial. loved it!

are you sure this test case my program give wrong answer because in my computer answer is 1 not -0.are you sure that you check correct submit my program id is:1681905

I’m in the same page :(!

I look here
http://campus.codechef.com/files/stderr/1681905/
Only admins, setter and tester have access to this.
Your answer for 8th test which is very small test is
DATASET NUMBER: 8
-0
-268156158598…
-0
-427197407184…
-125542034707…
-0
-0
-0
where … is some other digits (like hundreds of digits more)
Try to run your code on ideone.com using GNU C++ compiler against this test case.

1 Like

I used BFS as well. I got TLE. :frowning:

same here… :frowning:

@editorialist : great work to give additional links to similar problems :slight_smile: thanks. Things are really changing nicely in new year :slight_smile:

3 Likes

Its Nice…

@sarfarajey Read the bold tip in the beginning of the editorial.

1 Like