No, I don't think so. For every i (1 <= i <= N), we would be going in both directions. So, total steps moved will at maximum be N. Hence, the complexity is O(N*N)
Output won't come on screen. It will be printed in a file named "addout.txt". Also, make a file named "addin.txt" and write the input in it.
If you are getting confused with all this, I suggest you to do normal cin/cout while compiling and checking your code but put the above code before submitting it to the AIO Judge.
There is no question directly from Asymptotic Analysis. But but but.. you can't dream of being at IOI (even INOI) without being able to find the time and space complexity of your code.
This is a very frequent question and my answer is based on what great competitive programmers have already said multiple times. The online resources are good enough.
Start from the Competitive Programming Playlist if you already have a grip on any language.