fast io

Solutions on MaxInterview for fast io by the best coders in the world

showing results for - "fast io"
Candace
26 Jul 2016
1#include <bits/stdc++.h>
2using namespace std;
3
4int main()
5{
6    ios_base::sync_with_stdio(false);
7    cin.tie(NULL);
8    return 0;
9}
Kenzo
22 Jan 2018
1#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
Tymeo
09 Oct 2016
1void fastInput(int &x)
2    {
3        bool neg=false;
4        register int c;
5        x =0;
6        c=getchar();
7        if(c=='-')
8        {
9            neg = true;
10            c=getchar();
11        }
12        for(;(c>47 && c<58);c=getchar())
13          	//bit shifting is faster than other operation
14          	//here code below is same as 
15          	//x = x*10 + c-48
16          
17            x = (x<<1) + (x<<3) +c -48;
18        if(neg)
19            x *=-1;
20    }