Can somebody please give me some good source to study Fast IO in C++. By far all the answers to this question seem to be really vague
ios_base::sync_with_stdio(false);
cin.tie(NULL);
This should be enough.
4 Likes
Okay thanks a lot
I am still getting a TLE. My algo has O(nlogn) compexity for n<=10^6.
Some things you can try -
- Replace endl with β\nβ.
- arrays instead of vectors.
- avoiding sorting on structs.
2 Likes
Thanks that helped me in some test cases
Any more suggestions. My code is still giving a TLE
If you have tried fast io and also \n and still getting TLE then now itβs time to change your algorithm
Thanks a lot guys. Actually my algorithm was not completely optimized. After just some modifications it worked.
2 Likes