結果
| 問題 |
No.457 (^^*)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-03 10:41:30 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 800 bytes |
| コンパイル時間 | 291 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 17,572 KB |
| 最終ジャッジ日時 | 2024-10-06 17:01:19 |
| 合計ジャッジ時間 | 5,414 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 TLE * 2 -- * 7 |
ソースコード
S = input()
l = list(S)
left_count = 0
right_count = 0
flg = 0
left_flg = 0
right_flg = 0
for i in range(len(l)):
if l[i] == "(":
left_flg = 0
right_flg = 0
for j in range(i + 1, len(l)):
if l[j] == "*":
if left_flg == 0:
left_flg += 1
if right_flg == 2:
right_flg += 1
elif l[j] == "^":
if left_flg == 1 or left_flg == 2:
left_flg += 1
if right_flg == 0 or right_flg == 1:
right_flg += 1
elif l[j] == ")":
if left_flg == 3:
left_count += 1
if right_flg == 3:
right_count += 1
print(right_count,left_count)