Skip to content

Instantly share code, notes, and snippets.

@osjayaprakash
Last active December 10, 2015 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osjayaprakash/4412111 to your computer and use it in GitHub Desktop.
Save osjayaprakash/4412111 to your computer and use it in GitHub Desktop.
SPOJ, TEMPLATE, CPP
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <map>
#include <vector>
namespace IO{
const int SIZE = 1 << 19;
char buff[SIZE], *p = buff + SIZE;
char read_char(){
if( p == buff + SIZE ){
fread( buff, 1, SIZE, stdin );
p = buff;
}
return *(p++);
}
inline int read_str(char * s){
char c;
while( isspace(c = read_char()) );
while( !isspace(c = read_char()) ) {
*s=c;
s++;
}
*s=0;
return 0;
}
inline int read_int(){
int r = c-'0';
char c;
while( !isdigit( c = read_char() ) );
while( isdigit( c = read_char() ) )
r = 10*r + c - '0';
return r;
}
}
using namespace IO;
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define MAXX(a,b) (a)>(b)?(a):(b)
#define MOD 1000000007
#define MAX 100012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment