fork download
  1. //
  2. // Created by Abhishek Bansal on $DATE$
  3. //
  4. //#pragma GCC optimize ("O3")
  5. //#pragma GCC optimize("Ofast,no-stack-protector")
  6. //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,tune=native")
  7. #[[#include]]# <bits/stdc++.h>
  8. #define ll long long
  9. #define ld long double
  10. using namespace std;
  11. clock_t startTime;
  12. double getCurrentTime() {
  13. return (double)(clock() - startTime) / CLOCKS_PER_SEC;
  14. }
  15. /*------------------------------------------------IO_OPERATORS---------------------------------------------*/
  16. template<typename T, typename U> inline ostream &operator << (ostream &_out, const pair<T, U> &_p) { _out << _p.first << " " << _p.second; return _out; }
  17. template<typename T, typename U> inline istream &operator >> (istream &_in, pair<T, U> &_p) { _in >> _p.first >> _p.second; return _in; }
  18. template<typename T> inline ostream &operator << (ostream &_out, const vector<T> &_v) { if (_v.empty()) return _out; _out << _v.front(); for (auto _it = ++_v.begin(); _it != _v.end(); ++_it) _out << ' ' << *_it; return _out; }
  19. template<typename T> inline istream &operator >> (istream &_in, vector<T> &_v) { for (auto &_i : _v) _in >> _i; return _in; }
  20. template<typename T> inline ostream &operator << (ostream &_out, const set<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
  21. template<typename T> inline ostream &operator << (ostream &_out, const multiset<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
  22. template<typename T> inline ostream &operator << (ostream &_out, const unordered_set<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
  23. template<typename T> inline ostream &operator << (ostream &_out, const unordered_multiset<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
  24. template<typename T, typename U> inline ostream &operator << (ostream &_out, const map<T, U> &_m) { if (_m.empty()) return _out; _out << "{\"" << _m.begin()->first << "\", \"" << _m.begin()->second << "\"}"; for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) _out << ", { \"" << _it->first << "\", \"" << _it->second << "\"}"; return _out; }
  25. template<typename T, typename U> inline ostream &operator << (ostream &_out, const unordered_map<T, U> &_m) { if (_m.empty()) return _out; _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')'; for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) _out << ", (" << _it->first << ": " << _it->second << ')'; return _out; }
  26. //For 1 based indexing
  27. template<typename T>
  28. void out(const vector<T> &a, int n) {
  29. for (int i = 1; i <= n; ++i) {cout << a[i] << ' ';} cout << "\n";
  30. }
  31. template<typename T>
  32. void out(const vector<vector<T>> &a, int n, int m) {
  33. for (int i = 1; i <= n; ++i) {for (int j = 1; j <= m; ++j) {cout << a[i][j] << ' ';}cout << '\n';}
  34. }
  35.  
  36. void solve() {
  37.  
  38. }
  39.  
  40. int main() {
  41. ios_base::sync_with_stdio(false);cin.tie(nullptr);
  42.  
  43. startTime = clock();
  44. // freopen("input.txt", "r", stdin);
  45. // freopen("output.txt", "w", stdout);
  46. // cout << fixed << setprecision(20);
  47. int T = 1;
  48. while (T--) {
  49. solve();
  50. }
  51. return 0;
  52. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7:2: error: invalid preprocessing directive #[
 #[[#include]]# <bits/stdc++.h>
  ^
prog.cpp:11:1: error: ‘clock_t’ does not name a type
 clock_t startTime;
 ^~~~~~~
prog.cpp: In function ‘double getCurrentTime()’:
prog.cpp:13:21: error: ‘clock’ was not declared in this scope
     return (double)(clock() - startTime) / CLOCKS_PER_SEC;
                     ^~~~~
prog.cpp:13:31: error: ‘startTime’ was not declared in this scope
     return (double)(clock() - startTime) / CLOCKS_PER_SEC;
                               ^~~~~~~~~
prog.cpp:13:31: note: suggested alternative: ‘static’
     return (double)(clock() - startTime) / CLOCKS_PER_SEC;
                               ^~~~~~~~~
                               static
prog.cpp:13:44: error: ‘CLOCKS_PER_SEC’ was not declared in this scope
     return (double)(clock() - startTime) / CLOCKS_PER_SEC;
                                            ^~~~~~~~~~~~~~
prog.cpp: At global scope:
prog.cpp:16:41: error: ‘ostream’ does not name a type
 template<typename T, typename U> inline ostream &operator << (ostream &_out, const pair<T, U> &_p) { _out << _p.first << " " << _p.second; return _out; }
                                         ^~~~~~~
prog.cpp:17:41: error: ‘istream’ does not name a type
 template<typename T, typename U> inline istream &operator >> (istream &_in, pair<T, U> &_p) { _in >> _p.first >> _p.second; return _in; }
                                         ^~~~~~~
prog.cpp:18:29: error: ‘ostream’ does not name a type
 template<typename T> inline ostream &operator << (ostream &_out, const vector<T> &_v) { if (_v.empty()) return _out; _out << _v.front(); for (auto _it = ++_v.begin(); _it != _v.end(); ++_it) _out << ' ' << *_it; return _out; }
                             ^~~~~~~
prog.cpp:19:29: error: ‘istream’ does not name a type
 template<typename T> inline istream &operator >> (istream &_in, vector<T> &_v) { for (auto &_i : _v) _in >> _i; return _in; }
                             ^~~~~~~
prog.cpp:20:29: error: ‘ostream’ does not name a type
 template<typename T> inline ostream &operator << (ostream &_out, const set<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
                             ^~~~~~~
prog.cpp:21:29: error: ‘ostream’ does not name a type
 template<typename T> inline ostream &operator << (ostream &_out, const multiset<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
                             ^~~~~~~
prog.cpp:22:29: error: ‘ostream’ does not name a type
 template<typename T> inline ostream &operator << (ostream &_out, const unordered_set<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
                             ^~~~~~~
prog.cpp:23:29: error: ‘ostream’ does not name a type
 template<typename T> inline ostream &operator << (ostream &_out, const unordered_multiset<T> &_s) { if (_s.empty()) return _out; _out << *_s.begin(); for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) _out << ' ' << *_it; return _out; }
                             ^~~~~~~
prog.cpp:24:41: error: ‘ostream’ does not name a type
 template<typename T, typename U> inline ostream &operator << (ostream &_out, const map<T, U> &_m) { if (_m.empty()) return _out; _out << "{\"" << _m.begin()->first << "\", \"" << _m.begin()->second << "\"}"; for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) _out << ", { \"" << _it->first << "\", \"" << _it->second << "\"}"; return _out; }
                                         ^~~~~~~
prog.cpp:25:41: error: ‘ostream’ does not name a type
 template<typename T, typename U> inline ostream &operator << (ostream &_out, const unordered_map<T, U> &_m) { if (_m.empty()) return _out; _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')'; for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) _out << ", (" << _it->first << ": " << _it->second << ')'; return _out; }
                                         ^~~~~~~
prog.cpp:28:16: error: ‘vector’ does not name a type
 void out(const vector<T> &a, int n) {
                ^~~~~~
prog.cpp:28:22: error: expected ‘,’ or ‘...’ before ‘<’ token
 void out(const vector<T> &a, int n) {
                      ^
prog.cpp: In function ‘void out(int)’:
prog.cpp:29:26: error: ‘n’ was not declared in this scope
     for (int i = 1; i <= n; ++i) {cout << a[i] << ' ';} cout << "\n";
                          ^
prog.cpp:29:35: error: ‘cout’ was not declared in this scope
     for (int i = 1; i <= n; ++i) {cout << a[i] << ' ';} cout << "\n";
                                   ^~~~
prog.cpp:29:35: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
prog.cpp:1:1:
+#include <iostream>
 //
prog.cpp:29:35:
     for (int i = 1; i <= n; ++i) {cout << a[i] << ' ';} cout << "\n";
                                   ^~~~
prog.cpp:29:43: error: ‘a’ was not declared in this scope
     for (int i = 1; i <= n; ++i) {cout << a[i] << ' ';} cout << "\n";
                                           ^
prog.cpp:29:57: error: ‘cout’ was not declared in this scope
     for (int i = 1; i <= n; ++i) {cout << a[i] << ' ';} cout << "\n";
                                                         ^~~~
prog.cpp:29:57: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
prog.cpp: At global scope:
prog.cpp:32:16: error: ‘vector’ does not name a type
 void out(const vector<vector<T>> &a, int n, int m) {
                ^~~~~~
prog.cpp:32:22: error: expected ‘,’ or ‘...’ before ‘<’ token
 void out(const vector<vector<T>> &a, int n, int m) {
                      ^
prog.cpp:32:6: error: redefinition of ‘template<class T> void out(int)’
 void out(const vector<vector<T>> &a, int n, int m) {
      ^~~
prog.cpp:28:6: note: ‘template<class T> void out(int)’ previously declared here
 void out(const vector<T> &a, int n) {
      ^~~
prog.cpp: In function ‘int main()’:
prog.cpp:41:5: error: ‘ios_base’ has not been declared
     ios_base::sync_with_stdio(false);cin.tie(nullptr);
     ^~~~~~~~
prog.cpp:41:38: error: ‘cin’ was not declared in this scope
     ios_base::sync_with_stdio(false);cin.tie(nullptr);
                                      ^~~
prog.cpp:41:38: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
prog.cpp:43:5: error: ‘startTime’ was not declared in this scope
     startTime = clock();
     ^~~~~~~~~
prog.cpp:43:5: note: suggested alternative: ‘static’
     startTime = clock();
     ^~~~~~~~~
     static
prog.cpp:43:17: error: ‘clock’ was not declared in this scope
     startTime = clock();
                 ^~~~~
stdout
Standard output is empty