aboutsummaryrefslogtreecommitdiff
path: root/Template
diff options
context:
space:
mode:
authorTa180m2019-12-03 15:34:21 -0600
committerTa180m2019-12-03 15:34:21 -0600
commit4499dbbafdaf26ccf84f9d4bec4869ddd52bcab7 (patch)
tree48e5ab896388a5628018f9c97ce568f3585cbcef /Template
parenta8f2f33be95151f7257baa4994ccdd5c0a2bf08c (diff)
updated template
Diffstat (limited to 'Template')
-rw-r--r--Template/usaco.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Template/usaco.cpp b/Template/usaco.cpp
index fbc1d7f..6c30150 100644
--- a/Template/usaco.cpp
+++ b/Template/usaco.cpp
@@ -10,7 +10,7 @@
#include <unordered_map>
#include <cmath>
#include <cstring>
-#define init_io(pname) ifstream cin((string)pname+".in"); ofstream cout((string)pname+".out"); ios_base::sync_with_stdio(false); cin.tie(NULL)
+#define io(s) if (fopen(((string)s+".in").c_str(), "r")) { freopen(((string)s+".in").c_str(), "r", stdin); freopen(((string)s+".out").c_str(), "w", stdout); } ios_base::sync_with_stdio(false); cin.tie(NULL)
#define FOR(i, a, b, in) for (int i = (a); i < (b); i += in)
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b, in) for (int i = (a) - 1; i >= (b); i -= in)
@@ -27,6 +27,7 @@
#define rsz resize
#define mem(a, b) memset(a, (b), sizeof(a))
using namespace std;
+typedef string str;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd;
@@ -36,8 +37,8 @@ constexpr auto INF = (int)1e9;
constexpr auto LINF = (ll)1e18;
int main() {
- init_io("abc");
+ io("abc");
-}
+} \ No newline at end of file