結果
| 問題 | No.193 筒の数式 |
| コンテスト | |
| ユーザー |
nbisco
|
| 提出日時 | 2018-08-26 15:45:16 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 1,000 ms |
| コード長 | 574 bytes |
| 記録 | |
| コンパイル時間 | 388 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,452 KB |
| 最終ジャッジ日時 | 2026-03-21 21:29:43 |
| 合計ジャッジ時間 | 2,850 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
def strip_lzero(_s):
s = [str(int(i)) for i in _s.strip().replace("+", " ").replace("-", " ").split(" ")]
ret = []
ret.append(s.pop(0))
for c in _s:
if c == "+" or c == "-":
ret.append(c)
ret.append(s.pop(0))
return "".join(ret)
S = input()
max_v = -1000000000000
for i in range(len(S)):
s = S[i:] + S[:i]
if s[0] == "+" or s[0] == "-" or s[len(S)-1] == "+" or s[len(S)-1] == "-":
continue
else:
s = strip_lzero(s)
v = eval(s)
if max_v < v:
max_v = v
print(max_v)
nbisco