Skip to main content
now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10

C++ 338328

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];o[i];++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));o=o;)o.substrreplace(0,t)+s+&o[t+strlen,strlen(p)],s=p+99)s=p+99;bzero;bzero(q=p,198);}}} 

Try it online!Try it online!

C++ 338

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];o[i];++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}} 

Try it online!

C++ 328

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];o[i];++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));)o.replace(t,strlen(p),s=p+99);bzero(q=p,198);}}} 

Try it online!

now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10

C++ 345338

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++io=m[1];o[i];++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}} 

Try it online!Try it online!

C++ 345

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}} 

Try it online!

C++ 338

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];o[i];++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}} 

Try it online!

now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10

C++ 347345

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}} 

Try it online!Try it online!

C++ 347

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O(*s++=o[i]);if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}} 

Try it online!

C++ 345

Edits:

  • Thanks to @algorithmshark for lots of help making the original shorter
  • Thanks to @Adalynn for a good suggestion to save bytes
  • Thanks to @ceilingcat for many, many very nice pieces of golfing - now even shorter

Here is the code:

#import<bits/stdc++.h> #define N(x)o[i]);else if(n<x)o[i]==92? #define O (o[++i]):o[i]==47?n++: char p[198],*q=p,*s=p+99;int i,t;main(int n,char**m){for(std::string o=m[1];i<=o.size();++i){if(!N(3)putchar O putchar(N(4)*q++=O(*q++=N(5)*s++=O*s++=o[i];if(n>4){for(n=2;~(t=o.find(p,i+1));o=o.substr(0,t)+s+&o[t+strlen(p)])s=p+99;bzero(q=p,198);}}} 

Try it online!

Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
std::string is c++
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Commonmark migration
Source Link
Loading
added 472 characters in body
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Now even shorter
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
deleted 4 characters in body
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
deleted 3 characters in body
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
deleted 3 characters in body
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
deleted 4 characters in body
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading
Source Link
Jerry Jeremiah
  • 1.4k
  • 10
  • 10
Loading