結果
| 問題 | No.197 手品 |
| コンテスト | |
| ユーザー |
siman
|
| 提出日時 | 2016-03-22 07:06:29 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 99 ms / 1,000 ms |
| コード長 | 600 bytes |
| コンパイル時間 | 49 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-07-20 03:47:14 |
| 合計ジャッジ時間 | 5,960 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 43 |
コンパイルメッセージ
Syntax OK
ソースコード
class Yukicoder
def initialize
s1 = gets.chomp.chars
n = gets.to_i
s2 = gets.chomp.chars
success = true
success &= s1.sort == s2.sort
if success && (s1 & s2).size == 2
o_diff = (s1.index('o') - s2.index('o')).abs
x_diff = (s1.index('x') - s2.index('x')).abs
diff = [o_diff, x_diff].max
success &= diff <= n
if n == 1 && diff == 0 && ([s1,s2].include?(%w(o x o)) || [s1,s2].include?(%w(x o x)))
success &= diff > 0
end
end
if success
puts "FAILURE"
else
puts "SUCCESS"
end
end
end
Yukicoder.new
siman