fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int yt=1; //test variable
  4. bool qf=false; //fast io enabled/disabled
  5.  
  6. #define read freopen("in.txt","r",stdin)
  7. #define write freopen("out.txt","w",stdout)
  8. #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);qf=true;
  9.  
  10. #define sc scanf
  11. #define pr printf
  12. #define whi while
  13. #define ll long long
  14. #define ull unsigned long long
  15. #define lld I64d
  16. #define mp make_pair
  17. #define ff first
  18. #define ss second
  19. #define vc vector
  20. #define pb push_back
  21. #define ite iterator
  22. #define str string
  23. #define bl bool
  24. #define tr true
  25. #define fl false
  26.  
  27. #define endl '\n'
  28. #define ret return
  29. #define rsort greater<int>()
  30. #define nl if(qf==tr) pr("\n");else cout<<"\n";
  31. #define test if(qf==tr) pr("TEST %d\n",yt++);else cout<<"TEST "<<yt++<<"\n";
  32. #define gcd(a,b) __gcd(a,b)
  33. #define mod 1000000007
  34.  
  35. #define all(c) c.begin(),c.end()
  36. #define sz(c) c.size()
  37. #define clr(c) c.clear()
  38. #define fd(c,a) c.find(a)
  39. #define bg(c) c.begin()
  40. #define ed(c) c.end()
  41. #define ins(c,a) c.insert(a)
  42. #define rem(c,a) c.erase(a)
  43.  
  44. #define si(n) if(qf==fl) sc("%d",&n); else cin>>n;
  45. #define sll(n) if(qf==fl) sc("%lld",&n); else cin>>n;
  46. #define pi(n) if(qf==fl) pr("%d ",n); else cout<<n<<" ";
  47. #define pll(n) if(qf==fl) pr("%lld ",n); else cout<<n<<" ";
  48.  
  49. #define tc int t;if(qf==fl) si(t) else cin>>t;whi(t--)
  50. #define ct continue
  51. #define debug system("PAUSE");
  52.  
  53. class Quacking
  54. {
  55. public:
  56. int quack(string a)
  57. {
  58. int i,j,l,ans=0,lastpos;
  59. str quack="quack",b;
  60. whi(1)
  61. {
  62. bl found=fl;
  63. l=sz(a);
  64. b="";
  65. lastpos=-1;
  66. for(i=0,j=0;i<l;i++)
  67. {
  68. if(j<5 and a[i]==quack[j]) j++;
  69. else if(j==5)
  70. {
  71. found=tr;
  72. lastpos=i;
  73. j=0;
  74. i--;
  75. }
  76. else if(a[i]!=quack[j])
  77. {
  78. if(lastpos==-1) lastpos=i;
  79. b+=a[i];
  80. }
  81. }
  82. if(j==5) found=tr;
  83. else if(j!=0)
  84. {
  85. if(lastpos==-1) lastpos++;
  86. for(i=lastpos;i<l;i++) b+=a[i];
  87. }
  88. cout<<b<<endl;
  89. a=b;
  90. if(found==fl)
  91. {
  92. if(ans==0) ans=-1;
  93. break;
  94. }
  95. ans++;
  96. }
  97. if(a!="") ret -1;
  98. ret ans;
  99. }
  100. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty