Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define FAST_IO() do { \
  5. ios_base::sync_with_stdio(false); \
  6. cin.tie(NULL); \
  7. cout.tie(NULL); \
  8. } while (0);
  9. #define start_routine() int begtime = clock();
  10. #define end_routine() do { \
  11. int endtime = clock(); \
  12. cerr << "\n\n" << "Time elapsed: " \
  13. << (endtime - begtime) * 1000 / CLOCKS_PER_SEC \
  14. << " ms\n\n"; \
  15. } while (0);
  16.  
  17. #define ll long long int
  18. #define ull unsigned long long int
  19. #define db long double
  20. #define ff first
  21. #define ss second
  22. #define MP make_pair
  23. #define pb push_back
  24. #define lb lower_bound
  25. #define ub upper_bound
  26. #define pii pair<int, int>
  27. #define pdd pair<db, db>
  28. #define pll pair<ll, ll>
  29. #define vpl vector<pll>
  30. #define vll vector<ll>
  31. #define mod 1000000007
  32. #define mod1 998244353
  33. #define inf 1000000000000000007
  34. #define eps 0.000001
  35. #define stp fixed << setprecision(20)
  36. #define endl '\n'
  37.  
  38. #define codejam 0
  39. #define APNA_IO
  40. #define TYPE int
  41. #define RET int
  42.  
  43. std::vector<TYPE> to_vector(std::string);
  44. std::string from_vector(std::vector<RET>);
  45.  
  46. std::vector<RET> solve(vector<TYPE> ques, int val) {
  47. return ques;
  48. }
  49.  
  50. int main() {
  51. FAST_IO();
  52.  
  53. #ifdef APNA_IO
  54. start_routine();
  55. freopen("input.txt", "r", stdin);
  56. freopen("output.txt", "w", stdout);
  57. #endif
  58.  
  59. ll t;
  60. cin >> t;
  61.  
  62. for (ll i = 1; i <= t; ++i) {
  63. string s;
  64. int val;
  65. cin >> s >> val;
  66. vector<TYPE> ques = to_vector(s);
  67. if (codejam)
  68. cout<<"Case #"<<i<<": ";
  69. cout << from_vector(solve(ques, val)) << endl;
  70. }
  71.  
  72. #ifdef APNA_IO
  73. end_routine();
  74. #endif
  75.  
  76. return 0;
  77. }
  78.  
  79. std::vector<TYPE> to_vector(std::string str) {
  80. std::vector<TYPE> out;
  81. std::string i;
  82. std::istringstream tokenStream(str);
  83.  
  84. while (std::getline(tokenStream, i, ','))
  85. out.push_back(atoi(i.c_str()));
  86.  
  87. return out;
  88. }
  89.  
  90. std::string from_vector(std::vector<RET> arr) {
  91. std::string out = "";
  92.  
  93. for (int i= 0 ; i < arr.size(); ++i) {
  94. out += std::to_string(arr[i]);
  95. if (i != arr.size() - 1)
  96. out += ",";
  97. }
  98.  
  99. return out;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement