Skip to content

Commit 3a60182

Browse files
committed
fastinput c++
1 parent 59312a6 commit 3a60182

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Library/Miscellanious/fast_input.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
void si(int &ret){
2+
int ip=gc(),flag=1;ret=0;for(;ip<'0'||ip>'9';ip=gc())
3+
if(ip=='-'){flag=-1;ip=gc();break;}
4+
for(;ip>='0'&&ip<='9';ip=gc())ret=(ret<<1)+(ret<<3)+ip-'0';ret*=flag;
5+
}
6+
7+
void sl(ll &ret) {
8+
int ip=gc(),flag=1;ret=0;for(;ip<'0'||ip>'9';ip=gc())
9+
if(ip=='-'){flag=-1;ip=gc();break;}
10+
for(;ip>='0'&&ip<='9';ip=gc())ret=(ret<<1)+(ret<<3)+ip-'0';ret*=flag;
11+
}

0 commit comments

Comments
 (0)