Commits

Andrey Vihrov committed 8593560

Use stdio

Comments (0)

Files changed (1)

 #include <cassert>
 #include <cctype>
 #include <cmath>
+#include <cstdio>
 #include <cstdlib>
 #include <deque>
-#include <iomanip>
-#include <iostream>
-#include <fstream>
 #include <limits>
 #include <list>
 #include <map>
 #include <utility>
 #include <valarray>
 #include <vector>
-using namespace std;
-struct _{ios_base::Init i;_(){cin.sync_with_stdio(false);cin.tie(NULL);}
+using namespace std; static struct _{_(){
+#if defined(PROB) && (!defined(LOCAL_PC) || !defined(STDIO))
+freopen(PROB".in","r",stdin);freopen(PROB".out","w",stdout);
+#endif
 #if defined(_WIN32) && defined(LOCAL_PC)
-~_(){system("pause");}
+}~_(){system("pause");
 #endif
-}_; typedef long long LL; typedef unsigned long long ULL;
-#if defined(PROB) && (!defined(LOCAL_PC) || !defined(STDIO))
-struct __{filebuf a,b;__(){cin.rdbuf(a.open(PROB".in",ios::in));cout.rdbuf
-(b.open(PROB".out",ios::out));}~__(){cin.rdbuf(NULL);cout.rdbuf(NULL);}}__;
-#endif
+}}_; typedef long long LL; typedef unsigned long long ULL;
 #define FOR(i, a, b) for (long i = (a); i <= (b); ++i)
 #ifndef NDEBUG
 #define DOLOG cerr<< setw(10)<< __FUNCTION__<< ":"<< setw(3)<< __LINE__<< ": "