Problem 1B Error
Difference between en1 and en2, changed 1,320 character(s)
I have this code for problem 1B in python but in the test 7, runtime error occurs (Exit code 1).↵
What is the problem?↵

def Diagnose (s) :  ↵
    l=len(s);↵
    b=True;↵
    if (s[0]=="R") :↵
        if ("A" < s[1] < "Z") :↵
            ss=Type_1(s);↵
        else :↵
            for i in range(l):↵
                if (s[i]=="C"):↵
                    ss=Type_2(s,i);↵
                    b=False;↵
                    break;↵
            if (b==True):↵
                ss=Type_1(s);↵
    else :↵
        ss=Type_1(s);↵
    return(ss);↵


def Type_1 (s) :    #Example : BCS23↵
    n=0;    ↵
    while ( "A" <= s[n] <= "Z"):↵
        n=n+1;↵
    st=n;   ↵
    col=0;↵
    for i in range (n) : ↵
        col = col + (26**i) + ((ord(s[i])-ord("A")) * (26 ** (n-1)));↵
        n=n-1;↵
    col=str(col);↵
    ss=s[st:len(s)];↵
    return ("R" + ss + "C" + col);↵



def Type_2 (s,i) :↵
    ss="";↵
    st = str(s[1:i]);↵
    col = int(s[i+1:len(s)]);↵
    n=1;↵
    while ((col-(26**n)) > 0) :↵
        col =  col &mdash; (26**n);↵
        n=n+1;↵
    c = 0;↵
    for i in range (n-1,-1,-1) :↵
        v=0;↵
        while ( col > (26**i) ) :↵
            col =  col &mdash; (26**i);↵
            v=v+1;↵
        ss=ss+chr(v+ord("A"));↵
    ss=ss+st;↵
    return ss;↵
   ↵
s = [None] * 10**5;↵

n = int(input());↵
for i in range(n):↵
    s[i]=input();↵
for i in range(n):↵
    s[i]=Diagnose(s[i]);↵
for i in range(n):↵
    print(s[i]);↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English esy 2020-10-27 17:42:02 1320
en1 English esy 2020-10-27 17:36:26 138 Initial revision (published)