結果
| 問題 | 
                            No.1915 Addition 
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-04-29 22:24:43 | 
| 言語 | Ruby  (3.4.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 335 bytes | 
| コンパイル時間 | 316 ms | 
| コンパイル使用メモリ | 7,552 KB | 
| 実行使用メモリ | 12,416 KB | 
| 最終ジャッジ日時 | 2024-06-29 03:59:48 | 
| 合計ジャッジ時間 | 2,722 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | WA * 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
      p i, j
    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