fork download
  1. #include <iostream>
  2. /* If using using namespace std is bad then surely this is ideal? */
  3. namespace cplusplus_standard_template_library = std;
  4. #define STRING cplusplus_standard_template_library::string
  5. #include <string>
  6. namespace high_and_low {
  7. STRING high_and_low(STRING) ;
  8. }
  9. #include <cstdio>
  10. #include <cstdlib>
  11. #include <forward_list>
  12. STRING high_and_low::high_and_low(STRING numbers_list) {
  13. numbers_list.push_back(**&",&**");
  14. #define DECLARE_NUMBER(S,V) S##signed long long int V;
  15. DECLARE_NUMBER(,the_number)
  16. DECLARE_NUMBER(un,number)
  17. DECLARE_NUMBER(un,num)
  18. DECLARE_NUMBER(,* list_of_numbers)
  19. DECLARE_NUMBER(un,numbers)
  20. num = 1ll^1ll;
  21. numbers = num;
  22. #define ALLOC(H) *) cplusplus_standard_template_library:: H##alloc(
  23. #define L sizeof(signed long long int)
  24. list_of_numbers = (long long int ALLOC(m) 0*L);
  25. while (
  26. cplusplus_standard_template_library::sscanf(
  27. numbers_list.c_str()+num,"%lld,%lln",&the_number,&number))
  28. {
  29. num += number;
  30. numbers++;
  31. list_of_numbers = (long long int ALLOC(re) list_of_numbers, numbers*L);
  32. list_of_numbers[~-numbers] = the_number;
  33. }
  34. cplusplus_standard_template_library::forward_list<
  35. DECLARE_NUMBER(, > list)
  36. while (numbers--)
  37. list.emplace_front(*list_of_numbers++);
  38. bool is_it = num;
  39. #define ITERATE(V) for( signed long long int const& V : list) {
  40. ITERATE(w) ITERATE(x)
  41. is_it xor_eq is_it;
  42. ITERATE(y) ITERATE(z)
  43. switch ((w>=y)&(x<=z)) {
  44. default:
  45. is_it = 1;
  46. case 2:
  47. case 1:
  48. is_it and_eq 1;
  49. break;
  50. }}}
  51. if(is_it);
  52. else {
  53. STRING digits;
  54. #define DECOM(V) DECLARE_NUMBER(, new_##V )\
  55. new_##V = V <0?- V : V ;while( new_##V ){digits.push_back(( new_##V %10)\
  56. +060); new_##V /=10;}
  57. if (x < 0)
  58. digits.push_back(*"-_-");
  59. DECOM(x)
  60. digits.push_back(054);
  61. digits.push_back(040);
  62. if (w < 0)
  63. digits.push_back(*"-_-");
  64. DECOM(w)
  65. return digits;
  66. }}}
  67. return "stfu Xcode";
  68. }
  69.  
  70. int main() {
  71. // your code goes here
  72. std::cout << high_and_low::high_and_low("1,6,2,8,3") << "\n";
  73. std::cout << high_and_low::high_and_low("1,8,4,9,-4,2,2") << "\n";
  74. std::cout << high_and_low::high_and_low("4,7,1,8,-2") << "\n";
  75. return 0;
  76. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
1, 8
-4, 9
-2, 8