I’m totally new in this,I really don’t know how to use this. I’ve googled it,but I’ve got some methods with getchar_unlocked method() somthing like dat
#define getchar_unlocked gc()
void scanint(int &x)
{
register int c = gc();
x = 0;
for(;(c<48 || c>57);c = gc());
for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}
or
#define getcx getchar_unlocked
inline void inp( int &n )//fast input function
{
n=0;
int ch=getcx();int sign=1;
while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getcx();}
while( ch >= '0' && ch <= '9' )
n = (n<<3)+(n<<1) + ch-'0', ch=getcx();
n=n*sign;
}
but didn’t get it at all. If I wanna take input char,int,long and long long int, can I use getchar_unlocked( ) for faster input?I’m getting TLE for a problem. please help me how to take input for int,char,long,long long int int c++.
Thnq