結果
問題 |
No.1535 五七五
|
ユーザー |
|
提出日時 | 2021-10-30 23:32:31 |
言語 | Ruby (3.4.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 336 bytes |
コンパイル時間 | 198 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 64,340 KB |
最終ジャッジ日時 | 2024-10-07 13:56:02 |
合計ジャッジ時間 | 17,908 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 TLE * 3 |
コンパイルメッセージ
Syntax OK
ソースコード
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