結果

問題 No.653 E869120 and Lucky Numbers
ユーザー cielciel
提出日時 2018-02-23 23:17:45
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 13,184 KB
最終ジャッジ日時 2024-04-18 09:39:14
合計ジャッジ時間 4,384 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
12,160 KB
testcase_01 AC 83 ms
12,288 KB
testcase_02 AC 88 ms
12,160 KB
testcase_03 AC 89 ms
12,160 KB
testcase_04 AC 91 ms
12,160 KB
testcase_05 AC 86 ms
12,160 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 86 ms
12,416 KB
testcase_09 WA -
testcase_10 AC 83 ms
12,160 KB
testcase_11 WA -
testcase_12 AC 85 ms
12,160 KB
testcase_13 WA -
testcase_14 AC 84 ms
12,288 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 81 ms
12,160 KB
testcase_18 AC 80 ms
12,160 KB
testcase_19 AC 82 ms
12,288 KB
testcase_20 AC 81 ms
12,288 KB
testcase_21 AC 82 ms
12,160 KB
testcase_22 AC 85 ms
12,288 KB
testcase_23 WA -
testcase_24 AC 86 ms
12,288 KB
testcase_25 AC 91 ms
12,160 KB
testcase_26 AC 85 ms
12,160 KB
testcase_27 AC 81 ms
12,160 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 89 ms
12,928 KB
testcase_31 AC 82 ms
12,160 KB
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
s=gets.chomp.chars.map(&:to_i)
f=true
(s.size-1).downto(0){|i|
	if f&&[2,3,4].include?(i)
		if i==0
			puts :No
			exit
		end
		s[i-1]-=1
	elsif [6,7].include?(i)
		f=false
	else
		puts :No
		exit
	end
}
puts :Yes
0