Advertisement
tranxuanbach

Generator template

Jan 13th, 2019 (edited)
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.11 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <ext/pb_ds/assoc_container.hpp>
  3. #include <ext/pb_ds/tree_policy.hpp>
  4. using namespace std;
  5. using namespace __gnu_pbds;
  6.  
  7. #include <dir.h>
  8. #include <process.h>
  9.  
  10. // Optimization
  11.  
  12. //#pragma GCC optimize("O3")
  13. #define endl '\n'
  14.  
  15. // Shortcut
  16.  
  17. #define int long long
  18. #define eb emplace_back
  19. #define pb push_back
  20. #define pob pop_back
  21. #define mp make_pair
  22. #define upb upper_bound
  23. #define lwb lower_bound
  24. #define fi first
  25. #define se second
  26. #define For(i, l, r) for (int i = l; i < r; i++)
  27. #define ForE(i, l, r) for (int i = l; i <= r; i++)
  28. #define Ford(i, r, l) for (int i = r; i > l; i--)
  29. #define FordE(i, r, l) for (int i = r; i >= l; i--)
  30. #define Fora(i, a) for (auto i : a)
  31.  
  32. // I/O & Debug
  33.  
  34. #define PrintV(a) Fora(iiii, a) cout << iiii << ' '; cout << endl;
  35. #define PrintVl(a) Fora(iiii, a) cout << iiii << endl;
  36. #define PrintA(a, l, r) for (int iiii = l; iiii <= r; iiii++) cout << a[iiii] << ' '; cout << endl;
  37. #define PrintAl(a, l, r) for (int iiii = l; iiii <= r; iiii++) cout << a[iiii] << endl;
  38. #define Ptest(x) return cout << x, 0;
  39. #define gl(s) getline(cin, s);
  40. #define setpre(x) fixed << setprecision(x)
  41. /*
  42. #define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
  43. void DEB(istream_iterator<string> it) {}
  44. template<typename T, typename... Args>
  45. void DEB(istream_iterator<string> it, T a, Args... args){
  46.     cout << *it << " = " << a << endl;
  47.     DEB(++it, args...);
  48. }
  49. */
  50.  
  51. // Functions
  52.  
  53. //#define isvowel(a) (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
  54. #define bend(a) a.begin(), a.end()
  55. #define rbend(a) a.rbegin(), a.rend()
  56. #define mset(a) memset(a, 0, sizeof(a))
  57. #define mset1(a) memset(a, 1, sizeof(a))
  58. #define msetn1(a) memset(a, -1, sizeof(a))
  59. #define msetinf(a) memset(a, 0x3f, sizeof(a))
  60. #define gcd __gcd
  61. #define __builtin_popcount __builtin_popcountll
  62. mt19937 rando();
  63. int randt(int l, int r){ return (rando() % (r - l + 1) + l); }
  64.  
  65. // Data Structure
  66.  
  67. #define pque priority_queue
  68. #define mts multiset
  69. #define y0 _y0_
  70. #define y1 _y1_
  71. #define div divi
  72. typedef long long ll;
  73. typedef long double ld;
  74. typedef vector <int> vi;
  75. typedef vector <ll> vll;
  76. typedef vector <ld> vld;
  77. typedef vector <string> vs;
  78. typedef pair <int, int> pii;
  79. typedef pair <ll, ll> pll;
  80. typedef vector <vi > vvi;
  81. typedef vector <vll > vvll;
  82. typedef vector <pii > vpii;
  83. typedef vector <pll > vpll;
  84.  
  85. const int N = ;
  86. int mod = 1e9 + 7, mod1 = 998244353, mod2 = 1e9 + 9, inf = 1e9 + 7;
  87. ll infll = 1e18 + 7;
  88.  
  89. string tos(int x) {
  90.     string ans;
  91.     ans += (char)('0' + x / 10);
  92.     ans += (char)('0' + x % 10);
  93.     return ans;
  94. }
  95.  
  96. const int tests = ;
  97.  
  98. signed main() {
  99. //    ios_base::sync_with_stdio(0);
  100. //    cin.tie(0); cout.tie(0);
  101.     //freopen(".inp", "r", stdin);
  102.     //freopen(".out", "w", stdout);
  103.     ForE(test, 1, tests) {
  104.         mkdir(("TEST" + tos(test)).c_str());
  105.     }
  106.  
  107.     ForE(test, 1, tests) {
  108.         string cmd1 = "move /y .inp TEST00";
  109.         string cmd2 = "move /y .out TEST00";
  110.         cmd1[cmd1.length() - 2] = (char)('0' + test / 10);
  111.         cmd1[cmd1.length() - 1] = (char)('0' + test % 10);
  112.         cmd2[cmd2.length() - 2] = (char)('0' + test / 10);
  113.         cmd2[cmd2.length() - 1] = (char)('0' + test % 10);
  114.         ofstream out;
  115.         out.open(".inp");
  116.  
  117.        
  118.  
  119.         out.close();
  120.         int tim = clock();
  121.         system("sol.exe");
  122.         tim = clock() - tim;
  123.         system(cmd1.c_str());
  124.         system(cmd2.c_str());
  125.         cout << "SUCCESSFULLY CREATE TEST " << tos(test) << endl;
  126.         cout << "TIME: " << tim << endl;
  127.         cout << endl;
  128.     }
  129. }
  130.  
  131. /*
  132. ==================================+
  133. INPUT:                            |
  134. ------------------------------    |
  135. n m
  136.  
  137. ------------------------------    |
  138. 7 3
  139. ------------------------------    |
  140. ==================================+
  141. OUTPUT:                           |
  142. ------------------------------    |
  143. ans
  144.  
  145. ------------------------------    |
  146. 2
  147. ------------------------------    |
  148. ==================================+
  149. */
  150.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement