結果
問題 |
No.193 筒の数式
|
ユーザー |
|
提出日時 | 2015-04-27 09:22:28 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 12 ms / 1,000 ms |
コード長 | 445 bytes |
コンパイル時間 | 46 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-07-05 04:46:52 |
合計ジャッジ時間 | 885 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
#!/usr/bin/python import re from itertools import chain flatten = lambda listOfLists: chain.from_iterable(listOfLists) rotate = lambda arr, n: arr[n:] + arr[:n] s = raw_input() hamark = float('-inf') for i in xrange(len(s)): x = rotate(s, i) y = re.split('\D', x) z = re.split('\d+', x) if len(z[0] + z[-1]): continue w = ''.join(map(str, flatten(zip(z, map(int, y))))) hamark = max(hamark, eval(w)) print hamark