結果

問題 No.83 最大マッチング
ユーザー gemmaro
提出日時 2019-12-10 08:49:52
言語 Ruby
(3.4.1)
結果
AC  
実行時間 93 ms / 5,000 ms
コード長 273 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-06-23 20:59:28
合計ジャッジ時間 1,975 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

# 0: 6
# 1: 2 <=
# 2: 5
# 3: 5
# 4: 4
# 5: 5
# 6: 6
# 7: 3 <-
# 8: 7
# 9: 6

n = gets.chomp.to_i

# if n.even?
#   puts ("1" * (n / 2)).to_i
# else
#   puts 7 * 10 **
# end

s = '1' * (n / 2)
if n.even?
  puts s
else
  s[0] = '7'
  puts s
end
0