結果
| 問題 |
No.193 筒の数式
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-04 20:00:51 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 579 bytes |
| コンパイル時間 | 391 ms |
| コンパイル使用メモリ | 6,784 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 14:07:56 |
| 合計ジャッジ時間 | 1,261 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 WA * 5 |
ソースコード
# -*- coding:utf-8 -*- def calc(shiki): global nums stack = [] ans = 0 a = 0 ope = "+" shiki+="*" for i in shiki: if i in nums: stack.append(int(i)) else: keta = 1 a = 0 while len(stack) > 0: a += keta * stack.pop() keta *= 10 if ope == "-": ans -= a else: ans += a ope = i return ans if __name__ == "__main__": s = raw_input() nums = map(str,range(10)) prev = s[len(s)-1] mx = 0 for i in xrange(len(s)): if s[i] in nums and prev in nums: temp = s[i:len(s)] + s[0:i] mx = max(mx,calc(temp)) prev = s[i] print mx