Line 37-38 creates two vectors containing N empty vectors.
Takeinput adds another N vectors that contains N element.
So what you end up with is two vectors containing N+N rows, where the first N rows have no columns, and the last N rows have N columns.
The very best thing you can do is learn how to use your debugger, so that you can step through your code and find exactly where the runtime error is occurring.
By the way, there's no need to pass N into your Sum and Takeinput functions. Vectors know their own size, and you can query it with the size() method.
I'm guessing that Time limit exceeded is actually a runtime error (like you said in your first post) that is telling you that the code takes too long to run. This might happen if codechef gives you less input than what you expect so that your program just stands there waiting for input until codechef eventually gets tired of waiting and gives up.
when i try debugging programs on codeblocks IDE, it opens header file of that particular data structure ,i used in that program and error message starts popping on the screen
Are these errors preventing you from debugging your program, or are they part of the debugging in which case they might help you fix the error. Please, if you want us to help you you need to start posting more error messages. Just saying that you get errors is not helpful.