結果

問題 No.197 手品
ユーザー Tsuneo YoshiokaTsuneo Yoshioka
提出日時 2015-04-29 01:02:39
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 593 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 11,376 KB
実行使用メモリ 15,376 KB
最終ジャッジ日時 2023-09-09 15:52:17
合計ジャッジ時間 6,504 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 79 ms
15,204 KB
testcase_04 AC 81 ms
15,016 KB
testcase_05 AC 77 ms
15,108 KB
testcase_06 AC 79 ms
15,112 KB
testcase_07 AC 78 ms
15,048 KB
testcase_08 AC 79 ms
15,088 KB
testcase_09 AC 80 ms
15,152 KB
testcase_10 AC 79 ms
15,240 KB
testcase_11 AC 79 ms
15,012 KB
testcase_12 WA -
testcase_13 AC 78 ms
15,244 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 78 ms
15,208 KB
testcase_24 AC 78 ms
15,048 KB
testcase_25 AC 77 ms
15,284 KB
testcase_26 AC 77 ms
15,068 KB
testcase_27 WA -
testcase_28 AC 77 ms
15,168 KB
testcase_29 WA -
testcase_30 AC 78 ms
15,056 KB
testcase_31 AC 78 ms
15,296 KB
testcase_32 AC 78 ms
15,056 KB
testcase_33 WA -
testcase_34 AC 77 ms
15,140 KB
testcase_35 AC 77 ms
15,112 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 78 ms
15,164 KB
testcase_39 WA -
testcase_40 AC 78 ms
15,136 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 79 ms
15,048 KB
testcase_44 WA -
testcase_45 AC 80 ms
15,224 KB
testcase_46 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# http://yukicoder.me/problems/432
# No.197 手品
hats=Array.new(2)
hats[0]=gets.chomp
num=gets.to_i
hats[1]=gets.chomp

apos = Array.new(2).map{ Array.new }
(0...hats.length).each{|i|
    cnt = 0
    hats[i].each_char.with_index{|c,j|
        if(c=='o')
            apos[i][cnt] = j;
            cnt+=1
        end
    }
}

if apos[0].length != apos[1].length
    puts "SUCCESS"
    exit
end
difftotal = 0
(0...apos[0].length).each{|i|
    diff = (apos[0][i] - apos[1][i]).abs
    difftotal += diff
}
if difftotal > num || (num-difftotal)%2==1
    puts "SUCCESS"
else
    puts "FAILURE"
end
0