結果

問題 No.539 インクリメント
ユーザー pluto77pluto77
提出日時 2017-07-04 10:59:05
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 354 bytes
コンパイル時間 1,283 ms
コンパイル使用メモリ 76,576 KB
実行使用メモリ 100,380 KB
最終ジャッジ日時 2024-04-15 15:41:53
合計ジャッジ時間 4,398 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1,361 ms
100,380 KB
testcase_03 AC 1,087 ms
96,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_539

def f(ss):
 s=ss
 if not s[-1].isdigit():
  return s
 if s.isdigit():
  n1=int(s)+1
  return '0'*(len(s)-len(str(n1)))+str(n1)
 s1=''
 while s[-1].isdigit():
  s1+=s[-1]
  s=s[:-1]
 s2=str(int(s1[::-1])+1)
 if len(s1)>len(s2):
  s2='0'*(len(s1)-len(s2))+s2
 return s+s2

n=int(raw_input())
for i in xrange(n):
 temp=raw_input()
 print f(temp)
0