Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- typedef long double LD;
- #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- #define sortAndUnique(a) sort((a).begin(), a.end()), (a).erase(unique((a).begin(), (a).end()),(a).end())
- double tick() {
- static clock_t oldticks;
- clock_t newticks = clock();
- double diff = 1.0 * (newticks - oldticks) / CLOCKS_PER_SEC;
- oldticks = newticks;
- return diff;
- }
- #define DEBUG
- #ifdef DEBUG
- #define debug(args...) (Debugger()) , args
- class Debugger
- {
- public:
- Debugger(const std::string& _separator = " - ") :
- first(true), separator(_separator){}
- template<typename ObjectType> Debugger& operator , (const ObjectType& v)
- {
- if(!first)
- std:cerr << separator;
- std::cerr << v;
- first = false;
- return *this;
- }
- ~Debugger() { std:cerr << endl;}
- private:
- bool first;
- std::string separator;
- };
- #else
- #define debug(args...) // Just strip off all debug tokens
- #endif
- int main(void) {
- cerr << tick(); //Prints execution time on error screen
- }
Add Comment
Please, Sign In to add comment