Search found 2 matches

by astandrik
Mon Aug 29, 2016 6:30 pm
Forum: Volume 4 (400-499)
Topic: 458 - The Decoder
Replies: 71
Views: 14610

Re: 458 - The Decoder

Anyone pls help. Always getting WA

Code: Select all

import sys
f = sys.stdin
 
c = f.read(1)
while c != '':
    o = ord(c)
    if o == 10 or o == 13:
        sys.stdout.write(c)
    elif o < 135:
        sys.stdout.write(chr(o - 7))
    c = f.read(1)
sys.stdout.write('\n')
exit(0)
by astandrik
Wed Aug 24, 2016 10:24 pm
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 31214

Re: 10340 - All in All

Can anyone see why is it WA? All test cases are OK. import sys def findSubstr(s1, s2): if(len(s2) == 0) or (len(s1) > len(s2)): return False elif s1[0] == s2[0] and len(s1) == 1: return True elif s1[0] == s2[0] and len(s1) > 1: return findSubstr(s1[1:], s2[1:]) elif s1[0] != s2[0]: return findSubstr...

Go to advanced search