結果
| 問題 |
No.193 筒の数式
|
| コンテスト | |
| ユーザー |
Tawara
|
| 提出日時 | 2015-08-28 14:13:48 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 423 bytes |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 15:05:06 |
| 合計ジャッジ時間 | 973 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 5 |
ソースコード
S = raw_input() N = len(S) ans = 0 for i in range(N): if S[i-1].isdigit() and S[i].isdigit(): tmp = pre = 0 op = "+" ns = S[i:N] + S[0:i] for i in range(N): if ns[i].isdigit(): continue if op == "+": tmp += int(ns[pre:i]) else: tmp -= int(ns[pre:i]) op = ns[i] pre = i+1 else: if op == "+": tmp += int(ns[pre:N]) else: tmp -= int(ns[pre:N]) ans = max(ans,tmp) print ans
Tawara