Пример #1
0
def main():
    isOpen = stdarray.readBool2D()
    stdarray.write2D(flow(isOpen))
    stdio.writeln(percolates(isOpen))
Пример #2
0
def main():
    isOpen = stdarray.readBool2D()
    stdarray.write2D(flow(isOpen))
    stdio.writeln(percolates(isOpen))
Пример #3
0
def main():
    isAlive = stdarray.readBool2D()
    stdarray.write2D(living(isAlive))
    stdio.writeln(percolates(isAlive))
Пример #4
0
def main():

    import stdio

    stdio.writeln('A')
    stdio.writeln('--------------------')
    a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
    stdarray.write2D(a)
    stdio.writeln()

    stdio.writeln('B')
    stdio.writeln('--------------------')
    b = identity(5)
    stdarray.write2D(b)
    stdio.writeln()

    stdio.writeln('C')
    stdio.writeln('--------------------')
    c = rand(5, 5)
    stdarray.write2D(c)
    stdio.writeln()

    stdio.writeln('A^T')
    stdio.writeln('--------------------')
    at = transpose(a);
    stdarray.write2D(b)
    stdio.writeln()

    stdio.writeln('A + A^T')
    stdio.writeln('--------------------')
    d = add(a, at)
    stdarray.write2D(d)
    stdio.writeln()

    stdio.writeln('A * A^T')
    stdio.writeln('--------------------')
    e = multiplyMM(a, at)
    stdarray.write2D(e)
    stdio.writeln()
Пример #5
0
def main():
    open = stdarray.readBoolean2D()
    stdarray.write2D(flow(open))
    stdio.writeln(percolates(open))
Пример #6
0
def main():
    open = stdarray.readBoolean2D()
    stdarray.write2D(flow(open))
    stdio.writeln(percolates(open))