結果
| 問題 |
No.539 インクリメント
|
| コンテスト | |
| ユーザー |
fagfagdfa
|
| 提出日時 | 2017-08-24 02:38:48 |
| 言語 | Python2 (2.7.18) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,193 bytes |
| コンパイル時間 | 82 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 15,804 KB |
| 最終ジャッジ日時 | 2024-10-15 13:39:31 |
| 合計ジャッジ時間 | 4,623 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | WA * 1 TLE * 1 -- * 1 |
ソースコード
n = input()
for i in range(n):
s = raw_input()
tmp = ""
raw = [0, 0]
dot = 0
for j in reversed(range(len(s))):
ac = ord(s[j])
if ac >= 48 and ac <= 57:
if raw[1] == 0:
raw[1] = j
tmp += s[j]
elif ac == 46:
if j - 1 >= 0:
if ord(s[j - 1]) >=48 and ord(s[j - 1]) <= 57:
tmp += s[j]
dot = 1
elif len(tmp) > 0:
if raw[0] == 0:
raw[0] = j + 1
break
tmp = tmp[::-1]
if dot == 0:
ans = int(tmp)
ans += 1
a = ""
a += s[0:raw[0]]
a += str(ans)
if len(a) != len(s):
a += s[raw[1]:]
print a
else:
a = "0."
for i in reversed(range(len(tmp))):
if tmp[i - 1] != '.':
a += '0'
else:
a += '1'
break
ans = float(tmp) + float(a)
a = str(ans)
while len(a) != len(tmp):
a += '0'
b = ""
b += s[0:raw[0]]
b += a
if len(b) != len(s):
b += s[raw[1]:]
print b
fagfagdfa