Code works in Python but not in c++14

I will start by saying that I am relatively new to cp, and i know this is a mistake on my part.
There have been times when a correct logic works fine in python but not in c++, which im assuming is due to how I accept input.
when i use something like :
arr = list(map(int, input().strip().split())), it works and gives me an AC, but its alternative on c++ fails.
int n; cin >> n;
for(int i = 0; i < n; i++){
cin >> arr[i];
}
The question im currently facing this on is Feb’21 challenge dev 3 MAXFUN, so i cannot share the code as of now, but how can i implement the same over on c++14?
I have already wasted an entire day because i didnot think of trying it on python, and so im already at a lower rank. I would like to get this solved xD
I have seen some people use something like this :
ios::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
NOTE : I have absolutely no idea what this means.
but even when i put this over in my code it didnot get accpepted. Is there anything else i need to do in order to get the same results or maybe if some higher rated coder can help me through DMs?

Thank you in advance :slight_smile:

you should use long long int for array

2 Likes

oh that worked surprisingly, i thought int had a 2 x 10^9 range so i didnot bother trying.
Thanks a lot

1 Like

always try to check the worst cases. They help us a lot.

I do, its just that in this case i assumed i had done stuff correctly when i hadnt xD