Home > other >  ZOJ 1334 error
ZOJ 1334 error

Time:09-30

Do with python 3 ZOJ 1334 times the Non Zero Exit Error Error, have big help me see what problem please
The import sys
Dic=[' 0 ', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']

Def translate (string, x, y) :
M=int (string, x)
Result=[]
While yMod=m % y
Result. Append (dic) (mod)
Dec=m//y
M=dec
Result. Append (dic) [m]
Result. The reverse ()
Return '. Join (result)


While True:
Try:
The line=sys. Stdin. Readline () strip (). The split ()
String=line [0]
A=int (line [1])
B=int (line [2])
Result=translate (string, a, b)
If len (result) & gt; 7:
+ 7 print (' % s' % 'ERROR')
The else:
Print (' % + 7 s' % result)
Except EOFError:
Break

CodePudding user response:

Program looks good, what did you enter?

CodePudding user response:

1111000 2 10
1111000 2 16
2102101 3 10
2102101 3 15
12312 4 2
1 a 15 2
1234567 10 16
The ABCD 16 15
Give an example of input in these subjects are tested, the results also like sample output, but not AC

CodePudding user response:

AC 16 2
AC 16 4
AC 16 10
Tried all no problem
  • Related