結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-29 03:24:59 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 312 bytes |
| コンパイル時間 | 379 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-09-13 01:48:52 |
| 合計ジャッジ時間 | 6,402 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 WA * 19 RE * 5 |
コンパイルメッセージ
Syntax OK
ソースコード
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