結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
12,160 KB
testcase_01 AC 88 ms
12,160 KB
testcase_02 AC 90 ms
12,160 KB
testcase_03 AC 87 ms
12,416 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 AC 87 ms
12,160 KB
testcase_08 AC 86 ms
12,032 KB
testcase_09 AC 87 ms
12,288 KB
testcase_10 AC 88 ms
12,288 KB
testcase_11 AC 88 ms
12,160 KB
testcase_12 AC 89 ms
12,160 KB
testcase_13 AC 88 ms
12,160 KB
testcase_14 AC 88 ms
12,160 KB
testcase_15 AC 88 ms
12,288 KB
testcase_16 AC 86 ms
12,288 KB
testcase_17 AC 89 ms
12,288 KB
testcase_18 AC 1,234 ms
51,328 KB
testcase_19 AC 1,173 ms
51,328 KB
testcase_20 AC 1,270 ms
51,328 KB
testcase_21 AC 1,224 ms
51,456 KB
testcase_22 AC 1,260 ms
51,200 KB
testcase_23 AC 1,234 ms
51,328 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.bsearch{|x| x >= y - a} == y - a and
		s.bsearch{|x| x >= y + b} == y + b and
		s.bsearch{|x| x >= y + b + c} == y + b + c
}

puts cnt
		
0