結果

問題 No.457 (^^*)
コンテスト
ユーザー 6soukiti29
提出日時 2017-03-23 09:04:22
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 570 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 596 ms
コンパイル使用メモリ 20,704 KB
実行使用メモリ 21,396 KB
最終ジャッジ日時 2026-03-27 06:06:40
合計ジャッジ時間 7,896 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 TLE * 2 -- * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

S = input()
count_left = S.count("(")
count_right = S.count(")")
kr = 0
sumL = 0
sumR = 0
for si,s in enumerate(S):
	if s == "(":
		kl = 0
		countstar = 0
		countyama = 0
		countstya = 0
		Lface = 0
		Rface = 0
		for ti,t in enumerate(S[si:]):
			if t == "*":
				countstar = countstar + 1
				if countyama >= 2:
					Lface = 1
			elif t == "^":
				countyama = countyama + 1
				if countstya == 1:
					Rface = 1
				elif countstar >= 1:
					countstya = 1
			elif t == ")":
				sumR = sumR + Rface
				sumL = sumL + Lface
				kl = kl + 1
		kr = kr + 1
print(sumL,sumR)
0