結果

問題 No.197 手品
ユーザー yocto_sothothyocto_sothoth
提出日時 2020-11-29 03:33:20
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 15,412 KB
最終ジャッジ日時 2023-10-11 02:17:26
合計ジャッジ時間 6,059 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 79 ms
15,252 KB
testcase_04 AC 82 ms
15,164 KB
testcase_05 WA -
testcase_06 AC 80 ms
15,132 KB
testcase_07 AC 80 ms
15,028 KB
testcase_08 WA -
testcase_09 AC 80 ms
15,124 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
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 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 82 ms
15,124 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 80 ms
15,028 KB
testcase_31 WA -
testcase_32 AC 81 ms
15,028 KB
testcase_33 WA -
testcase_34 AC 82 ms
15,036 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 80 ms
15,300 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 80 ms
15,032 KB
testcase_44 WA -
testcase_45 WA -
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
elsif n == 0
  puts s_before == s_after ? :FAILUE : :SUCCESS
elsif n == 1
  d = s_before.dup
  d[0], d[1] = d[1], d[0]
  s_before[0], s_before[1] = s_before[1], s_before[0]
  puts(d == s_after || s_before == s_after ? :FAILUE : :SUCCESS)
else
  puts :FAILUE
end
0