Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 1681

Code-golf is a competition to solve a particular problem in the fewest bytes of source code. If you want to score by characters instead of bytes, please state this explicitly in the challenge. If source code length is not the primary scoring criterion, consider using another tag instead.

1
vote
Python (146 152 characters) Here's a "real" answer, if my Wolfram Alpha one doesn't please: n=711 r=lambda v:range(v,n) print [[a*0.01,b*0.01,c*0.01,d*0.01]for a in r(1)for b in r(a)for c in r(b)for …
answered Jun 17 '11 by ESultanik
8
votes
Wolfram Alpha (51 characters) You can also run it yourself. solve(a+b+c+d=7.11,a*b*c*d=7.11,a>0,b>=a,c>=b,d>=c)
answered Jun 17 '11 by ESultanik
3
votes
Python, 1219 Bytes I didn't spend very much time/effort trying to golf this, but I might improve it if other answers start popping up. I use A* search with an admissible heuristic, guaranteeing opti …
answered Jul 15 '15 by ESultanik
2
votes
Python: 1303 Characters This is some super ugly code, and it isn't particularly efficient, but I believe it works: import sys from itertools import product,combinations e=[] p=[[[0,(c,r,o,[])][c!='. …
answered Feb 20 '13 by ESultanik
0
votes
Python, 356 characters I took a slight hit for reading from the command line: from sys import argv x=int(argv[1]) t=argv[3::2] c=argv[2::2] n=len(t) s=[0]*n d=1 g=1 while d: i=0 s[i]+=1 …
answered Sep 28 '11 by ESultanik
4
votes
Python, 699 This is just a quick pass (ran out of time for now). It can probably use a lot more golfing. import sys m=[list(x)for x in sys.stdin.read().split('\n')] e=enumerate S=set s=lambda x:S([ …
answered Jul 3 '13 by ESultanik
41
votes
Brainf*ck (755 characters) This is based off of a technique developed by Erik Bosman (ejbosman at cs.vu.nl). Note that the "ESultanik's Quine!" text is actually necessary for it to be a quine! ->++ …
answered Jun 16 '11 by ESultanik
2
votes
Python, 245 256 import sys def t(n,l):return sum(map(lambda x:int(x**0.5+0.5)**2==x,[int(n[i:j+1])for i in range(l)for j in range(i,l)if n[i]!='0']))/float(l) print max(map(lambda x:(x,t(str(x),len(s …
answered Jun 1 '11 by ESultanik
18
votes
Python → Brainf*ck (185 223 233 255 285 287 303 characters) Code import random as r,sys r.seed(int(sys.argv[1])) c=list('<>.,+-')+[''] n=9/r.random() def b(): global n s='' while n>0:n-=1;o=r.cho …
answered Jun 21 '11 by ESultanik
1
vote
Python: 192 Characters (not including whitespace) import itertools def l(a,i,r): s=[b for b in r if a[i][b]] k=len(s) if k<2: return 0 return 2.0*sum(map(lambda x:a[x[0]][x[1] …
answered Jul 19 '12 by ESultanik
4
votes
Python, 478 471 characters (Not including comments. 452 450 characters not including the imports.) import sys,itertools i=[list(x)for x in sys.stdin.read().strip().split('\n')] h=len(i) w=len(i[0]) …
answered May 26 '11 by ESultanik
1
vote
Python 2.7, 503 Bytes This isn't particularly golfed, nor is it particularly efficient; it's just a relatively condensed enumeration of feasible strings that are brute-forced. I don't think it would …
answered Jan 6 '16 by ESultanik
4
votes
Python, 188 132 101 95 87 characters n=input() s=[] a=k=0 b=1 while s[:k]!=s[k:]or k<1:s+=[a%n];k=len(s)/2;a,b=b,a+b print k Usage $ echo 10 | python pisano.py 60 For example: $ for i in {1..50 …
answered Oct 21 '12 by ESultanik