this is the question.
www.codechef.com/problems/CTEAMS

i wrote this code
http://ideone.com/h5Gimy
it gives success but when i pass an input it gives sigsev error.please someone help!!

Recommended Answers

scanf("%d", &t);

And

scanf("%d%d", &x[q][0], &x[q][1]);

Notice the ampersand (address-of operator). scanf() requires a pointer to an object, and you were passing some random number which was extremely unlikely to be a valid address in your address space.

Jump to Post

All 2 Replies

scanf("%d", &t);

And

scanf("%d%d", &x[q][0], &x[q][1]);

Notice the ampersand (address-of operator). scanf() requires a pointer to an object, and you were passing some random number which was extremely unlikely to be a valid address in your address space.

i made some changes...http://ideone.com/m2j5GJ
but still problem output has some problem i guess..in codeblocks its giving the same answer but in ideone output is different..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.