Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 17 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13

C (gcc), (削除) 286 (削除ここまで) (削除) 240 (削除ここまで) 227218 bloody bytes (o,_,o)

-4655 bloody bytes thanks to ceilingcat!

#define S(x,y)x^=y^=x^=y
o,a,b,c,r;f(int*_){r=0;c=atoic=atoi(_);v(o,_,o=strlen(_),r=0);r=r;}v(k,_,o,i)char*_;{k-1-k?({for(v(k-1,_,o,0);for(i=0;++i<k;v;i<k;v(k-1,_,o,!++i))S(_[k%2?0:i-1]_[k%2*i],_[k-1]_[k]);}):(a=atoi(_)/exp10(o/2))*(b=atoi(_+o/2))==c&&(a+b)%10?r=1:0;}

Try it online! Try it online!

C (gcc), (削除) 286 (削除ここまで) (削除) 240 (削除ここまで) 227 bloody bytes (o,_,o)

-46 bloody bytes thanks to ceilingcat!

#define S(x,y)x^=y^=x^=y
o,a,b,c,r;f(int*_){r=0;c=atoi(_);v(o,_,o=strlen(_));r=r;}v(k,_,o,i)char*_;{k-1?({v(k-1,_,o);for(i=0;++i<k;v(k-1,_,o))S(_[k%2?0:i-1],_[k-1]);}):(a=atoi(_)/exp10(o/2))*(b=atoi(_+o/2))==c&&(a+b)%10?r=1:0;}

Try it online!

C (gcc), (削除) 286 (削除ここまで) (削除) 240 (削除ここまで) 218 bloody bytes (o,_,o)

-55 bloody bytes thanks to ceilingcat!

#define S(x,y)x^=y^=x^=y
o,a,b,c,r;f(int*_){c=atoi(_);v(o,_,o=strlen(_),r=0);r=r;}v(k,_,o,i)char*_;{--k?({for(v(k,_,o,0);i<k;v(k,_,o,!++i))S(_[k%2*i],_[k]);}):(a=atoi(_)/exp10(o/2))*(b=atoi(_+o/2))==c&&(a+b)%10?r=1:0;}

Try it online!

deleted 1 character in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13

C (gcc), (削除) 286 (削除ここまで) (削除) 240 (削除ここまで) 229227 bloody bytes (o,_,o)

#define S(x,y)x^=y^=x^=y
o,a,b,c,r;f(_int*_)int*_;{r=0;c=atoi(_);v(o,_,o=strlen(_));r=r;}v(k,_,o,i)char*_;{k-1?({v(k-1,_,o);for(i=0;++i<k;v(k-1,_,o))S(_[k%2?0:i-1],_[k-1]);}):(a=atoi(_)/exp10(o/2))*(b=atoi(_+o/2))==c&&(a+b)%10?r=1:0;}

Try it online! Try it online!

C (gcc), (削除) 286 (削除ここまで) (削除) 240 (削除ここまで) 229 bloody bytes (o,_,o)

#define S(x,y)x^=y^=x^=y
o,a,b,c,r;f(_)int*_;{r=0;c=atoi(_);v(o,_,o=strlen(_));r=r;}v(k,_,o,i)char*_;{k-1?({v(k-1,_,o);for(i=0;++i<k;v(k-1,_,o))S(_[k%2?0:i-1],_[k-1]);}):(a=atoi(_)/exp10(o/2))*(b=atoi(_+o/2))==c&&(a+b)%10?r=1:0;}

Try it online!

C (gcc), (削除) 286 (削除ここまで) (削除) 240 (削除ここまで) 227 bloody bytes (o,_,o)

#define S(x,y)x^=y^=x^=y
o,a,b,c,r;f(int*_){r=0;c=atoi(_);v(o,_,o=strlen(_));r=r;}v(k,_,o,i)char*_;{k-1?({v(k-1,_,o);for(i=0;++i<k;v(k-1,_,o))S(_[k%2?0:i-1],_[k-1]);}):(a=atoi(_)/exp10(o/2))*(b=atoi(_+o/2))==c&&(a+b)%10?r=1:0;}

Try it online!

deleted 5 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13

I tried other algorithms, but couldn't find a shorter one. I leave here the dumbest of the tries, which is a solution that doesn't solve the problem. It will probably findonly finds most of the vampire numbers though.(probably).

I tried other algorithms, but couldn't find a shorter one. I leave here the dumbest of the tries, which is a solution that doesn't solve the problem. It will probably find most of the vampire numbers though..

I tried other algorithms, but couldn't find a shorter one. I leave here the dumbest of the tries, which is a solution that doesn't solve the problem. It only finds most of the vampire numbers (probably).

edited body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 829 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 8 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
deleted 8 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 47 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
edited body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 8 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 1991 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 24 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
deleted 6 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
Fixed wikipedia link not to go via Google (please avoid copying links directly from Google search results in future, unless you know what you're doing!)
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290
Loading
deleted 2 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 9 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 34 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 34 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
deleted 8 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
added 5 characters in body
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading
Source Link
anotherOne
  • 1.1k
  • 7
  • 13
Loading

AltStyle によって変換されたページ (->オリジナル) /