結果

問題 No.486 3 Straight Win(3連勝)
ユーザー 👑 horiesinitihoriesiniti
提出日時 2017-06-24 05:47:14
言語 Ruby
(3.2.2)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 11,480 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-09-08 11:10:35
合計ジャッジ時間 4,056 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,164 KB
testcase_01 AC 82 ms
15,036 KB
testcase_02 AC 81 ms
15,064 KB
testcase_03 AC 83 ms
15,124 KB
testcase_04 AC 82 ms
15,204 KB
testcase_05 AC 81 ms
15,132 KB
testcase_06 AC 82 ms
15,064 KB
testcase_07 AC 81 ms
15,228 KB
testcase_08 AC 80 ms
15,328 KB
testcase_09 AC 82 ms
15,076 KB
testcase_10 AC 82 ms
15,164 KB
testcase_11 AC 81 ms
15,248 KB
testcase_12 AC 81 ms
15,248 KB
testcase_13 AC 81 ms
15,164 KB
testcase_14 AC 79 ms
15,272 KB
testcase_15 AC 79 ms
15,132 KB
testcase_16 AC 81 ms
15,228 KB
testcase_17 AC 80 ms
15,340 KB
testcase_18 AC 80 ms
15,120 KB
testcase_19 AC 81 ms
15,344 KB
testcase_20 AC 82 ms
15,144 KB
testcase_21 AC 81 ms
15,228 KB
testcase_22 AC 80 ms
15,076 KB
testcase_23 AC 79 ms
15,312 KB
testcase_24 AC 81 ms
15,188 KB
testcase_25 AC 82 ms
15,344 KB
testcase_26 AC 80 ms
15,252 KB
testcase_27 AC 80 ms
15,332 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s=gets.chomp
w=0
e=0
i=0

while s.size>i
	c=s[i]
	if c=="O" then
		e=e+1
		w=0
	else
		w=w+1
		e=0
	end
	if e==3 then
		puts "East"
		break
	elsif w==3 then
		puts "West"
		break
	end
	i=i+1
end
if w<3 && e<3 then
	puts "NA"
end
0