fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. template<class S, class T> inline S chmax(S &a, T b){
  5. if(a<b){
  6. a=b;
  7. }
  8. return a;
  9. }
  10. #define main dummy_main
  11. int main(){
  12. return 0;
  13. }
  14. #undef main
  15. class Solution{
  16. public:
  17. int maxRepeating(string A, string B){
  18. int res = 0;
  19. int tmp;
  20. int i;
  21. int j;
  22. for(i=(0);i<(A.size());i++){
  23. tmp = 0;
  24. j = i;
  25. while(A.substr(j,B.size()) == B){
  26. tmp++;
  27. j += B.size();
  28. }
  29. chmax(res, tmp);
  30. }
  31. return res;
  32. }
  33. }
  34. ;
  35. // cLay version 20201206-1
  36.  
  37. // --- original code ---
  38. // #define main dummy_main
  39. // {}
  40. // #undef main
  41. //
  42. // class Solution {
  43. // public:
  44. // int maxRepeating(string A, string B) {
  45. // int res = 0, tmp, i, j;
  46. // rep(i,A.size()){
  47. // tmp = 0;
  48. // j = i;
  49. // while(A.substr(j,B.size()) == B){
  50. // tmp++;
  51. // j += B.size();
  52. // }
  53. // res >?= tmp;
  54. // }
  55. // return res;
  56. // }
  57. // };
  58.  
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