結果
問題 | No.539 インクリメント |
ユーザー | nebukuro09 |
提出日時 | 2017-06-30 22:37:36 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 803 ms / 2,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 679 ms |
コンパイル使用メモリ | 77,104 KB |
実行使用メモリ | 91,196 KB |
最終ジャッジ日時 | 2024-04-15 06:43:05 |
合計ジャッジ時間 | 3,346 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
75,452 KB |
testcase_01 | AC | 152 ms
85,908 KB |
testcase_02 | AC | 803 ms
91,196 KB |
testcase_03 | AC | 679 ms
90,152 KB |
ソースコード
import re N = input() for i in xrange(N): S = raw_input() R = re.findall('[0-9]+', S) if len(R) == 0: print S else: T = R[-1] I = S.rfind(T) L = len(T) if T[0] == '0': X = str(int(T) + 1) X = '0' * (L - len(X)) + X print S[:I] + X + S[I+L:] else: X = str(int(T) + 1) print S[:I] + X + S[I+L:]