結果
| 問題 |
No.1915 Addition
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-29 22:30:38 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 81 ms / 2,000 ms |
| コード長 | 322 bytes |
| コンパイル時間 | 464 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-06-29 04:06:10 |
| 合計ジャッジ時間 | 2,403 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
コンパイルメッセージ
Syntax OK
ソースコード
t = gets.to_i
t.times do
c = gets.to_i
cs = c.to_s
k = cs.size
i = ('1' * k).to_i
j = i
while true
if i.to_s.size > k
k += 1
i = ('1' * k).to_i
j = i
end
x = 1
x = i - c if i > c
if (cs + x.to_s).to_i % (c + x) == 0
puts x
break
end
i += j
end
end