結果
問題 |
No.197 手品
|
ユーザー |
![]() |
提出日時 | 2016-03-22 06:50:07 |
言語 | Ruby (3.4.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 39 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,672 KB |
最終ジャッジ日時 | 2024-06-27 13:20:45 |
合計ジャッジ時間 | 5,317 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 RE * 1 |
other | AC * 29 WA * 7 RE * 7 |
コンパイルメッセージ
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 o_diff = (s1.index('o') - s2.index('o')).abs x_diff = (s1.index('x') - s1.index('x')).abs diff = [o_diff, x_diff].max success &= diff < n if success puts "FAILURE" else puts "SUCCESS" end end end Yukicoder.new