結果

問題 No.2558 中国剰余定理
ユーザー keidenkeiden
提出日時 2024-09-24 23:11:48
言語 Scheme
(Gauche-0.9.15)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 6,684 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-09-24 23:11:51
合計ジャッジ時間 2,043 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (main args)
  (let*
    (
      (a (read))
      (b (read))
      (c (read))
      (d (read))
    )
    (let loop
      ((n 0))
      (if (equal? (modulo (+ (* a n) c) b) d)
        (print (+ c (* a n)))
        (loop (+ n 1)))))
  0)
0