結果

問題 No.197 手品
ユーザー yocto_sothothyocto_sothoth
提出日時 2020-11-29 03:24:59
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 312 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 11,208 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2023-10-11 02:16:44
合計ジャッジ時間 6,657 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 81 ms
15,164 KB
testcase_04 AC 84 ms
15,352 KB
testcase_05 AC 83 ms
15,160 KB
testcase_06 AC 82 ms
15,168 KB
testcase_07 AC 81 ms
15,356 KB
testcase_08 AC 82 ms
15,340 KB
testcase_09 AC 81 ms
15,124 KB
testcase_10 AC 82 ms
15,336 KB
testcase_11 AC 83 ms
15,156 KB
testcase_12 WA -
testcase_13 AC 83 ms
15,032 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 84 ms
15,124 KB
testcase_24 AC 82 ms
15,264 KB
testcase_25 AC 82 ms
15,124 KB
testcase_26 AC 82 ms
15,120 KB
testcase_27 WA -
testcase_28 AC 82 ms
15,128 KB
testcase_29 WA -
testcase_30 AC 81 ms
15,256 KB
testcase_31 RE -
testcase_32 AC 82 ms
15,172 KB
testcase_33 WA -
testcase_34 AC 81 ms
15,288 KB
testcase_35 AC 82 ms
15,132 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 83 ms
15,124 KB
testcase_39 WA -
testcase_40 AC 82 ms
15,292 KB
testcase_41 WA -
testcase_42 RE -
testcase_43 AC 81 ms
15,196 KB
testcase_44 WA -
testcase_45 AC 81 ms
15,292 KB
testcase_46 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s_before = gets.chomp
n = gets.to_i
s_after = gets.chomp

before_o = s_before.count('o')
after_o = s_after.count('o')

if before_o != after_o
  puts :SUCCESS
else
  e = before_o < 3 - before_o ? 'o' : 'x'
  d = (s_before.index(e) - s_after.index(e)).abs
  puts(d <= n && (n - d).even? ? :FAILURE : :SUCCESS)
end
0