repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* transcode.c (trans_open_i): check the result of rb_transcoding_open.
[ruby-svn.git]
/
benchmark
/
other-lang
/
ack.py
blob
9968e7cfcf76a0aa9d3365a31f46468288bd3bde
1
import
sys
2
sys
.
setrecursionlimit
(
5000000
)
3
4
def
Ack
(
M
,
N
):
5
if
(
not
M
):
6
return
(
N
+
1
)
7
if
(
not
N
):
8
return
(
Ack
(
M
-
1
,
1
) )
9
return
(
Ack
(
M
-
1
,
Ack
(
M
,
N
-
1
)) )
10
11
def
main
():
12
NUM
=
9
13
sys
.
setrecursionlimit
(
10000
)
14
Ack
(
3
,
NUM
)
15
16
main
()