結果
| 問題 |
No.457 (^^*)
|
| コンテスト | |
| ユーザー |
1235486527
|
| 提出日時 | 2019-12-21 14:25:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 659 ms / 2,000 ms |
| コード長 | 610 bytes |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 76,348 KB |
| 最終ジャッジ日時 | 2024-07-19 08:36:15 |
| 合計ジャッジ時間 | 3,950 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
S = input()
n = len(S)
l = r = 0
for i in range(n-4):
if S[i] != '(':
continue
lf = rf = False
lt = rt = ''
for s in S[i+1:]:
if s == ')':
l += lf
r += rf
elif not lf & rf:
if s == '*':
if lt == '^^':
lf = True
if rt == '':
rt += s
elif s == '^':
if lt == '' or lt == '^':
lt += s
if rt == '*':
rt += s
elif rt == '*^':
rf = True
print(l, r)
1235486527