結果
| 問題 | No.457 (^^*) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-12-08 02:49:23 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 309 ms / 2,000 ms |
| + 59µs | |
| コード長 | 679 bytes |
| 記録 | |
| コンパイル時間 | 84 ms |
| コンパイル使用メモリ | 64,392 KB |
| 実行使用メモリ | 58,504 KB |
| 最終ジャッジ日時 | 2026-10-19 11:06:53 |
| 合計ジャッジ時間 | 3,757 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
s = input()
def solve(s):
left = 0
right = 0
for i in range(len(s)):
if s[i] != '(':
continue
lfc = 0
rfc = 0
for j in range(i + 1, len(s)):
if s[j] == '^':
if lfc < 2:
lfc += 1
if rfc > 0:
rfc += 1
elif s[j] == '*':
if lfc == 2:
lfc = 3
if rfc == 0:
rfc = 1
elif s[j] == ')':
if lfc > 2:
left += 1
if rfc > 2:
right += 1
return [left, right]
print(*solve(s))