結果

問題 No.1915 Addition
ユーザー TKG1TKG1
提出日時 2022-04-29 21:56:37
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 290 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 20,200 KB
最終ジャッジ日時 2023-09-11 13:02:18
合計ジャッジ時間 4,955 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
19,500 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

t = gets.to_i
t.times do
  c = gets.to_i
  cs = c.to_s

  i = 3*(c/3+1)
  j = 10
  while true
    x = i - c
    if (cs + x.to_s).to_i % (c + x) == 0
      puts x
      break
    end
    if (cs + j.to_s).to_i % (c + j) == 0
      puts j
      break
    end
    i += 3
    j += 10
  end
end

0