結果

問題 No.1535 五七五
ユーザー 小野寺健小野寺健
提出日時 2021-10-30 23:32:31
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 62,160 KB
最終ジャッジ日時 2024-04-16 16:29:50
合計ジャッジ時間 4,309 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
12,416 KB
testcase_01 AC 89 ms
12,032 KB
testcase_02 AC 90 ms
12,160 KB
testcase_03 AC 90 ms
12,288 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 AC 90 ms
12,416 KB
testcase_08 AC 90 ms
12,160 KB
testcase_09 AC 91 ms
12,288 KB
testcase_10 AC 92 ms
12,288 KB
testcase_11 AC 93 ms
12,416 KB
testcase_12 AC 95 ms
12,416 KB
testcase_13 AC 90 ms
12,288 KB
testcase_14 AC 93 ms
12,288 KB
testcase_15 AC 90 ms
12,288 KB
testcase_16 AC 91 ms
12,416 KB
testcase_17 AC 91 ms
12,416 KB
testcase_18 AC 1,360 ms
61,860 KB
testcase_19 AC 1,278 ms
62,020 KB
testcase_20 AC 1,309 ms
62,148 KB
testcase_21 AC 1,365 ms
62,160 KB
testcase_22 AC 1,371 ms
61,888 KB
testcase_23 AC 1,366 ms
61,976 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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

s = [0]
gets.split(" ").map{|s| s.length}.each {|j|
	s << s[-1] + j
}

cnt = 0
1.upto(N-2) {|i|
	y = s[i]
	cnt += 1 if s[0..i-1].bsearch{|x| x >= y - a} == y - a and
		s[i..-1].bsearch{|x| x >= y + b} == y + b and
		s[i+1..-1].bsearch{|x| x >= y + b + c} == y + b + c
}

puts cnt
0