Each table row shows performance measurements for this program with a particular command-line input value N.
N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
---|
Read the ↓ make, command line, and program output logs to see how this program was run.
Read benchmark to see what this program should do.
# The Computer Language Benchmarks Game # http://shootout.alioth.debian.org/ # contributed by Dominique Wahli # 2to3 # modified by Justin Peel from sys import stdin,stdout from re import sub, findall def main(): seq = stdin.read() write = stdout.write ilen = len(seq) seq = sub(b'>.*\n|\n', b'', seq) clen = len(seq) variants = ( b'agggtaaa|tttaccct', b'[cgt]gggtaaa|tttaccc[acg]', b'a[act]ggtaaa|tttacc[agt]t', b'ag[act]gtaaa|tttac[agt]ct', b'agg[act]taaa|ttta[agt]cct', b'aggg[acg]aaa|ttt[cgt]ccct', b'agggt[cgt]aa|tt[acg]accct', b'agggta[cgt]a|t[acg]taccct', b'agggtaa[cgt]|[acg]ttaccct') for f in variants: write(f + b' ' +bytes(str(len(findall(f, seq)))) + b'\n') subst = { b'B' : b'(c|g|t)', b'D' : b'(a|g|t)', b'H' : b'(a|c|t)', b'K' : b'(g|t)', b'M' : b'(a|c)', b'N' : b'(a|c|g|t)', b'R' : b'(a|g)', b'S' : b'(c|g)', b'V' : b'(a|c|g)', b'W' : b'(a|t)', b'Y' : b'(c|t)'} for f, r in subst.items(): seq = sub(f, r, seq) write(b'\n') write(bytes(str(ilen)) + b'\n') write(bytes(str(clen)) + b'\n') write(bytes(str(len(seq))) + b'\n') main()
Wed, 28 Sep 2022 09:30:44 GMT COMMAND LINE: /usr/bin/pyston regexdna.pyston-5.pyston 0 < regexdna-input10000.txt PROGRAM FAILED PROGRAM OUTPUT: Traceback (most recent call last): File "regexdna.pyston-5.pyston", line 42, in <module> main() File "regexdna.pyston-5.pyston", line 15, in main seq = sub(b'>.*\n|\n', b'', seq) File "/opt/pyston/lib/python3.8-pyston2.3/re.py", line 210, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: cannot use a bytes pattern on a string-like object