結果

問題 No.342 一番ワロタww
ユーザー yuruhiyayuruhiya
提出日時 2020-07-02 21:26:06
言語 Crystal
(1.11.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 18,452 ms
コンパイル使用メモリ 258,956 KB
実行使用メモリ 4,864 KB
最終ジャッジ日時 2023-09-13 10:57:13
合計ジャッジ時間 18,914 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,772 KB
testcase_01 AC 3 ms
4,692 KB
testcase_02 AC 3 ms
4,768 KB
testcase_03 AC 3 ms
4,744 KB
testcase_04 AC 3 ms
4,668 KB
testcase_05 AC 2 ms
4,852 KB
testcase_06 AC 3 ms
4,760 KB
testcase_07 AC 3 ms
4,776 KB
testcase_08 AC 3 ms
4,864 KB
testcase_09 AC 2 ms
4,680 KB
testcase_10 AC 2 ms
4,804 KB
testcase_11 AC 3 ms
4,760 KB
testcase_12 AC 2 ms
4,740 KB
testcase_13 AC 2 ms
4,680 KB
testcase_14 AC 3 ms
4,668 KB
testcase_15 AC 3 ms
4,772 KB
testcase_16 AC 2 ms
4,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = read_line.gsub(/^w+/, "")
match = s.scan(/w+/)
range = match.map { |i| {i.begin.not_nil!, i.end.not_nil!} }.unshift({0, 0})
len = range.max_of { |r| r[1] - r[0] }
puts range.each_with_index.to_a.select { |(r, i)|
  r[1] - r[0] == len
}.join('\n') { |(r, i)|
  s[range[i - 1][1]...range[i][0]]
}
0