Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Base headers.
- #include"base/index.hpp"
- // Topic-specific headers.
- #include"topics/index.hpp"
- // Run the solution to the problem.
- void solve(){}
- #ifndef LOCAL
- // Optional online input and output filenames respectively.
- constexpr char const*infile=nullptr;
- constexpr char const*outfile=nullptr;
- #endif
- // Run the program.
- int main(){
- // Desynchronize the standard C and C++ streams.
- ios::sync_with_stdio(false);
- // Configure the standard character input stream.
- cin.tie(nullptr);
- // Configure the standard character output stream.
- cout<<fixed<<setprecision(numeric_limits<f80>::max_digits10);
- #ifdef LOCAL
- // Configure the standard character error stream locally.
- cerr<<fixed<<setprecision(numeric_limits<f80>::max_digits10);
- // Run the solution to the problem at least once locally.
- LOG(YELLOW,BOLD,"Start");
- do{
- solve();
- LOG(GREEN,BOLD,"Accepted");
- cin>>ws;
- }while(cin.good());
- LOG(YELLOW,BOLD,"Finish");
- #else
- // Maybe redirect the input online.
- if constexpr(infile){
- static ifstream const in(infile);
- cin.rdbuf(in.rdbuf());
- }
- // Maybe redirect the output online.
- if constexpr(outfile){
- static ofstream const out(outfile);
- cout.rdbuf(out.rdbuf());
- }
- // Run the solution to the problem once online.
- solve();
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment