結果
問題 | No.539 インクリメント |
ユーザー |
|
提出日時 | 2022-02-08 20:42:54 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,039 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 82,404 KB |
実行使用メモリ | 182,408 KB |
最終ジャッジ日時 | 2024-06-23 16:26:47 |
合計ジャッジ時間 | 1,733 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | MLE * 3 |
ソースコード
T = int(input())for i in range(T):f1 = Falsef2 = Falset = input()n = len(t)b = []num = []a = []for j in range(n-1,-1,-1):if not f2:if f1 == False and t[j].isnumeric():num.append(t[j])f1 = Trueelif f1 == False and not t[j].isnumeric():b.append(t[j])elif f1 and t[j].isnumeric():num.append(t[j])else:a.append(t[j])f2 = Trueelse:a.append(t[j])b.reverse()a.reverse()if not num:print(*b,sep='')else:c = []f = Truefor s in num:if f and s=='9':c.append('0')continueelif f:c.append(str(int(s)+1))f = Falseelse:c.append(s)if f:c.append('1')c.reverse()ans = a+c+bprint(''.join(ans))