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. class OrderedStream{
  10. public:
  11. int ptr;
  12. vector<string> str;
  13. OrderedStream(int n){
  14. ptr = 1;
  15. while(str.size() < n+3){
  16. str.push_back("");
  17. }
  18. }
  19. vector<string> insert(int id, string value){
  20. vector<string> res;
  21. str[id] = value;
  22. if(id==ptr){
  23. while(str[ptr] != ""){
  24. res.push_back(str[ptr++]);
  25. }
  26. }
  27. return res;
  28. }
  29. }
  30. ;
  31. // cLay varsion 20201115-2
  32.  
  33. // --- original code ---
  34. // #define main dummy_main
  35. // {}
  36. // #undef main
  37. //
  38. // class OrderedStream {
  39. // public:
  40. // int ptr;
  41. // vector<string> str;
  42. //
  43. // OrderedStream(int n) {
  44. // ptr = 1;
  45. // while(str.size() < n+3) str.push_back("");
  46. // }
  47. //
  48. // vector<string> insert(int id, string value) {
  49. // vector<string> res;
  50. // str[id] = value;
  51. // if(id==ptr) while(str[ptr] != "") res.push_back(str[ptr++]);
  52. // return res;
  53. // }
  54. // };
  55.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty