結果

問題 No.1535 五七五
ユーザー 小野寺健小野寺健
提出日時 2021-10-30 23:56:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 698 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 67,212 KB
最終ジャッジ日時 2024-04-16 16:30:07
合計ジャッジ時間 7,839 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
12,160 KB
testcase_01 AC 91 ms
12,160 KB
testcase_02 AC 88 ms
12,288 KB
testcase_03 AC 90 ms
12,288 KB
testcase_04 AC 615 ms
63,008 KB
testcase_05 AC 698 ms
67,212 KB
testcase_06 AC 630 ms
67,176 KB
testcase_07 AC 89 ms
12,288 KB
testcase_08 AC 88 ms
12,160 KB
testcase_09 AC 89 ms
12,288 KB
testcase_10 AC 90 ms
12,416 KB
testcase_11 AC 91 ms
12,160 KB
testcase_12 AC 89 ms
12,160 KB
testcase_13 AC 89 ms
12,160 KB
testcase_14 AC 89 ms
12,288 KB
testcase_15 AC 90 ms
12,160 KB
testcase_16 AC 89 ms
12,160 KB
testcase_17 AC 88 ms
12,288 KB
testcase_18 AC 548 ms
65,116 KB
testcase_19 AC 555 ms
64,996 KB
testcase_20 AC 565 ms
65,244 KB
testcase_21 AC 554 ms
64,984 KB
testcase_22 AC 572 ms
65,120 KB
testcase_23 AC 565 ms
65,024 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
a, b, c = gets.split(" ").map{|s| s.to_i}


s = {0=>true}
sum = 0
gets.split(" ").map{|s| s.length}.each{|j|
	sum += j
	s[sum] = true
}

cnt = 0
s.each {|y, i|
	cnt += 1 if s.include?(y-a) and s.include?(y+b) and s.include?(y+b+c)
}

puts cnt
0