Skip to content

Instantly share code, notes, and snippets.

@sudo-panda
Created August 11, 2020 15:35
Show Gist options
  • Select an option

  • Save sudo-panda/3101ec5b3183011c6d3db14b2f489af6 to your computer and use it in GitHub Desktop.

Select an option

Save sudo-panda/3101ec5b3183011c6d3db14b2f489af6 to your computer and use it in GitHub Desktop.
C++ tips to get around TLE : fastscan
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