Skip to content

Instantly share code, notes, and snippets.

@kirugan
Last active October 11, 2020 20:39
Show Gist options
  • Save kirugan/9430602811f621a081a03564b0acd920 to your computer and use it in GitHub Desktop.
Save kirugan/9430602811f621a081a03564b0acd920 to your computer and use it in GitHub Desktop.
Template for competitive programming
#include <bits/stdc++.h>
using namespace std;
#define ALL(X) begin(X), end(X)
int main() {
// solution comes here
}
@kirugan
Copy link
Author

kirugan commented Sep 25, 2019

In some contest systems, files are used for input and output. An easy solution for this is to write the code as usual using standard streams, but add the following lines to the beginning of the code:

freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment