結果

問題 No.83 最大マッチング
ユーザー gemmarogemmaro
提出日時 2019-12-10 08:49:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 273 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 11,256 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2023-09-06 01:56:37
合計ジャッジ時間 2,083 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,304 KB
testcase_01 AC 81 ms
15,124 KB
testcase_02 AC 80 ms
15,288 KB
testcase_03 AC 81 ms
15,128 KB
testcase_04 AC 81 ms
15,088 KB
testcase_05 AC 80 ms
15,184 KB
testcase_06 AC 81 ms
15,164 KB
testcase_07 AC 80 ms
15,060 KB
testcase_08 AC 79 ms
15,340 KB
testcase_09 AC 78 ms
15,296 KB
testcase_10 AC 79 ms
15,128 KB
testcase_11 AC 79 ms
15,360 KB
testcase_12 AC 79 ms
15,164 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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