結果

問題 No.1469 programing
ユーザー kanno_kannokanno_kanno
提出日時 2021-04-22 18:29:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,678 ms / 3,000 ms
コード長 174 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 11,456 KB
実行使用メモリ 25,176 KB
最終ジャッジ日時 2023-09-17 10:15:40
合計ジャッジ時間 6,454 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,128 KB
testcase_01 AC 81 ms
15,140 KB
testcase_02 AC 80 ms
15,312 KB
testcase_03 AC 81 ms
15,300 KB
testcase_04 AC 86 ms
15,144 KB
testcase_05 AC 83 ms
15,292 KB
testcase_06 AC 83 ms
15,124 KB
testcase_07 AC 84 ms
15,028 KB
testcase_08 AC 143 ms
15,396 KB
testcase_09 AC 163 ms
15,456 KB
testcase_10 AC 157 ms
15,648 KB
testcase_11 AC 239 ms
15,864 KB
testcase_12 AC 195 ms
15,560 KB
testcase_13 AC 80 ms
15,072 KB
testcase_14 AC 287 ms
16,044 KB
testcase_15 AC 239 ms
15,980 KB
testcase_16 AC 343 ms
16,540 KB
testcase_17 AC 2,678 ms
25,176 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def solve(line)
  length = line.length

  print line[0]
  (1...length).each do |i|
    next if line[i - 1] == line[i]

    print line[i]
  end

  puts
end

solve(gets.chomp)
0