Created
August 11, 2020 15:35
-
-
Save sudo-panda/3101ec5b3183011c6d3db14b2f489af6 to your computer and use it in GitHub Desktop.
C++ tips to get around TLE : fastscan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void fastscan(int &x) | |
| { | |
| bool neg=false; | |
| register int c; | |
| x =0; | |
| c=getchar(); | |
| if(c=='-') | |
| { | |
| neg = true; | |
| c=getchar(); | |
| } | |
| for(;(c>47 && c<58);c=getchar()) | |
| x = 48 + (x<<1) + (x<<3) - c; | |
| if(!neg) | |
| x *=-1; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment