結果
問題 | No.457 (^^*) |
ユーザー | suppy193 |
提出日時 | 2017-01-12 10:40:24 |
言語 | Ruby (3.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 589 bytes |
コンパイル時間 | 36 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 36,328 KB |
最終ジャッジ日時 | 2024-06-01 06:22:46 |
合計ジャッジ時間 | 8,544 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 92 ms
19,236 KB |
testcase_01 | AC | 89 ms
12,160 KB |
testcase_02 | AC | 93 ms
12,416 KB |
testcase_03 | AC | 91 ms
12,032 KB |
testcase_04 | AC | 89 ms
12,160 KB |
testcase_05 | AC | 87 ms
12,160 KB |
testcase_06 | AC | 91 ms
12,160 KB |
testcase_07 | AC | 98 ms
12,416 KB |
testcase_08 | AC | 123 ms
12,288 KB |
testcase_09 | AC | 201 ms
12,288 KB |
testcase_10 | AC | 783 ms
12,416 KB |
testcase_11 | TLE | - |
testcase_12 | TLE | - |
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| flag_l = false flag_r = false if s[i] == '(' (i+4...s.length).each do |j| if s[j] == ')' #puts s[i..j] if !flag_l if re_l.match(s[i..j]) count_l += 1 flag_l = true end else count_l += 1 end if !flag_r if re_r.match(s[i..j]) count_r += 1 flag_r = true end else count_r += 1 end end end end end print "#{count_l} #{count_r}\n"