結果

問題 No.395 永遠の17歳
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2018-03-18 20:13:34
言語 Ruby
(3.3.0)
結果
AC  
実行時間 78 ms / 1,000 ms
コード長 137 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 11,484 KB
実行使用メモリ 15,352 KB
最終ジャッジ日時 2023-08-28 16:19:20
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,264 KB
testcase_01 AC 75 ms
15,264 KB
testcase_02 AC 76 ms
15,128 KB
testcase_03 AC 77 ms
15,060 KB
testcase_04 AC 78 ms
15,088 KB
testcase_05 AC 77 ms
15,332 KB
testcase_06 AC 77 ms
15,056 KB
testcase_07 AC 77 ms
15,196 KB
testcase_08 AC 76 ms
15,048 KB
testcase_09 AC 76 ms
15,300 KB
testcase_10 AC 76 ms
15,060 KB
testcase_11 AC 76 ms
15,060 KB
testcase_12 AC 75 ms
15,144 KB
testcase_13 AC 75 ms
15,328 KB
testcase_14 AC 75 ms
15,200 KB
testcase_15 AC 76 ms
15,180 KB
testcase_16 AC 75 ms
15,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

A = gets.to_i

1.upto(A - 7) do |i|
  quo, remainder = A.divmod(i)
  if quo == 1 && remainder == 7
    puts i
    exit
  end
end

puts -1
0