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 CustomStack{
  10. public:
  11. int arr[1000];
  12. int sz;
  13. int mx;
  14. CustomStack(int maxSize){
  15. mx = maxSize;
  16. sz = 0;
  17. }
  18. void push(int x){
  19. if(sz < mx){
  20. arr[sz++] = x;
  21. }
  22. }
  23. int pop(){
  24. if(sz==0){
  25. return -1;
  26. }
  27. return arr[--sz];
  28. }
  29. void increment(int k, int val){
  30. int i;
  31. for(i=(0);i<(k);i++){
  32. arr[i] += val;
  33. }
  34. }
  35. }
  36. ;
  37. // cLay varsion 20200325-1
  38.  
  39. // --- original code ---
  40. // #define main dummy_main
  41. // {}
  42. // #undef main
  43. //
  44. // class CustomStack {
  45. // public:
  46. // int arr[1000], sz, mx;
  47. // CustomStack(int maxSize) {
  48. // mx = maxSize;
  49. // sz = 0;
  50. // }
  51. //
  52. // void push(int x) {
  53. // if(sz < mx) arr[sz++] = x;
  54. // }
  55. //
  56. // int pop() {
  57. // if(sz==0) return -1;
  58. // return arr[--sz];
  59. // }
  60. //
  61. // void increment(int k, int val) {
  62. // rep(i,k) arr[i] += val;
  63. // }
  64. // };
  65.  
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