結果
問題 | No.457 (^^*) |
ユーザー | suppy193 |
提出日時 | 2017-01-11 16:57:34 |
言語 | Ruby (3.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 374 ms |
コンパイル使用メモリ | 11,436 KB |
実行使用メモリ | 23,824 KB |
最終ジャッジ日時 | 2023-08-23 08:29:29 |
合計ジャッジ時間 | 7,187 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 79 ms
15,260 KB |
testcase_01 | AC | 77 ms
15,276 KB |
testcase_02 | AC | 77 ms
15,012 KB |
testcase_03 | AC | 78 ms
15,236 KB |
testcase_04 | AC | 77 ms
15,012 KB |
testcase_05 | AC | 78 ms
15,332 KB |
testcase_06 | AC | 82 ms
15,104 KB |
testcase_07 | AC | 106 ms
16,208 KB |
testcase_08 | AC | 291 ms
16,996 KB |
testcase_09 | AC | 1,519 ms
18,092 KB |
testcase_10 | TLE | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
コンパイルメッセージ
Syntax OK
ソースコード
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"