結果

問題 No.457 (^^*)
ユーザー suppy193suppy193
提出日時 2017-01-11 16:57:34
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 403 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 23,968 KB
最終ジャッジ日時 2024-06-01 06:10:37
合計ジャッジ時間 6,388 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
19,232 KB
testcase_01 AC 90 ms
12,288 KB
testcase_02 AC 88 ms
12,288 KB
testcase_03 AC 93 ms
12,288 KB
testcase_04 AC 89 ms
12,160 KB
testcase_05 AC 90 ms
12,416 KB
testcase_06 AC 89 ms
12,416 KB
testcase_07 AC 118 ms
13,440 KB
testcase_08 AC 281 ms
14,080 KB
testcase_09 AC 1,382 ms
14,592 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.strip
#puts s

re_l = /\^.*\^.*\*/
re_r = /\*.*\^.*\^/

#p re_l.match(s)
#p re_r.match(s)

count_l = 0
count_r = 0
(0...s.length - 1).each do |i|
	if s[i] == '('
		(i...s.length).each do |j|
			if s[j] == ')'
				#puts s[i..j]
				if re_l.match(s[i..j])
					count_l += 1
				end
				if re_r.match(s[i..j])
					count_r += 1
				end
			end
		
		end
		
	end
	
end
print "#{count_l} #{count_r}\n"
0