fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define main dummy_main
  5. int main(){
  6. return 0;
  7. }
  8. #undef main
  9. #define ListNode dummy_ListNode
  10. struct ListNode{
  11. }
  12. ;
  13. #undef ListNode
  14. class Solution{
  15. public:
  16. ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2){
  17. int Q5VJL1cS, RZTsC2BF;
  18. ListNode*aa;
  19. ListNode*bb;
  20. ListNode*st;
  21. ListNode*ed;
  22. st = ed = list2;
  23. while(ed->next != NULL){
  24. ed = ed->next;
  25. }
  26. aa = bb = list1;
  27. for(Q5VJL1cS=(0);Q5VJL1cS<(a-1);Q5VJL1cS++){
  28. aa = aa->next;
  29. }
  30. for(RZTsC2BF=(0);RZTsC2BF<(b+1);RZTsC2BF++){
  31. bb = bb->next;
  32. }
  33. aa->next = st;
  34. ed->next = bb;
  35. return list1;
  36. }
  37. }
  38. ;
  39. // cLay version 20201206-1
  40.  
  41. // --- original code ---
  42. // #define main dummy_main
  43. // {}
  44. // #undef main
  45. //
  46. // #define ListNode dummy_ListNode
  47. // struct ListNode {};
  48. // #undef ListNode
  49. //
  50. // class Solution {
  51. // public:
  52. // ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2) {
  53. // ListNode *aa, *bb, *st, *ed;
  54. // st = ed = list2;
  55. // while(ed->next != NULL) ed = ed->next;
  56. // aa = bb = list1;
  57. // rep(a-1) aa = aa->next;
  58. // rep(b+1) bb = bb->next;
  59. // aa->next = st;
  60. // ed->next = bb;
  61. // return list1;
  62. // }
  63. // };
  64.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:16:3: error: ‘ListNode’ does not name a type; did you mean ‘fesetmode’?
   ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2){
   ^~~~~~~~
   fesetmode
stdout
Standard output is empty