Advertisement
tranxuanbach

reformat from themis to hackerrank format

Nov 22nd, 2020 (edited)
1,166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 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 <windows.h>
  9. #include <process.h>
  10.  
  11. #define fi first
  12. #define se second
  13. #define For(i, l, r) for (int i = l; i < r; i++)
  14. #define ForE(i, l, r) for (int i = l; i <= r; i++)
  15. #define FordE(i, l, r) for (int i = l; i >= r; i--)
  16. #define Fora(v, a) for (auto v: a)
  17. #define bend(a) a.begin(), a.end()
  18. #define isz(a) ((signed)a.size())
  19.  
  20. typedef long long ll;
  21. typedef long double ld;
  22. typedef pair <int, int> pii;
  23. typedef vector <int> vi;
  24. typedef vector <pii> vpii;
  25. typedef vector <vi> vvi;
  26.  
  27. string name;
  28.  
  29. int tests;
  30.  
  31. string itos(int x){
  32.     string ans;
  33.     ans += x / 10 + '0';
  34.     ans += x % 10 + '0';
  35.     return ans;
  36. }
  37.  
  38. signed main(){
  39.     ios_base::sync_with_stdio(0);
  40.     cin.tie(0); cout.tie(0);
  41.     //freopen(".inp", "r", stdin);
  42.     //freopen(".out", "w", stdout);
  43. cin >> name >> tests;
  44. mkdir("input");
  45. mkdir("output");
  46. For(test, 0, tests){
  47.     system(("copy /y \"Test" + itos(test) + "\\" + name + ".inp\" \"input\"").c_str());
  48.     system(("copy /y \"Test" + itos(test) + "\\" + name + ".out\" \"output\"").c_str());
  49.     system(("ren \"input\\" + name + ".inp\" input" + itos(test) + ".txt").c_str());
  50.     system(("ren \"output\\" + name + ".out\" output" + itos(test) + ".txt").c_str());
  51. }
  52. system(("7z a -tzip " + name + ".zip input output").c_str());
  53. system("rmdir /s /q input output");
  54. }
  55.  
  56. /*
  57. ==================================================+
  58. INPUT:                                            |
  59. --------------------------------------------------|
  60.  
  61. --------------------------------------------------|
  62. ==================================================+
  63. OUTPUT:                                           |
  64. --------------------------------------------------|
  65.  
  66. --------------------------------------------------|
  67. ==================================================+
  68. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement