結果
問題 | No.193 筒の数式 |
ユーザー | tkzw_21 |
提出日時 | 2015-04-26 22:33:11 |
言語 | Python2 (2.7.18) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 487 bytes |
コンパイル時間 | 48 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-05 03:01:51 |
合計ジャッジ時間 | 922 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 1 |
ソースコード
s = raw_input() n = len(s) ret = -1000000000000 f = True if s[0] == '+' or s[0] == '-': f = False for j in range(0,len(s)-1): if not s[j].isdigit() and not s[j+1].isdigit(): f = False if f: ret = eval(s) for i in range(1,n): t = str(s[-i:] + s[:n-i]) # print t if not t[0].isdigit() or not t[-1].isdigit(): continue f = True for j in range(0,len(t)-1): if not t[j].isdigit() and not t[j+1].isdigit(): f = False if f: # print t ret = max(ret,eval(t)) print ret