結果
問題 | No.639 An Ordinary Sequence |
ユーザー |
|
提出日時 | 2018-01-26 23:32:52 |
言語 | Scheme (Gauche-0.9.15) |
結果 |
AC
|
実行時間 | 25 ms / 1,000 ms |
コード長 | 361 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 7,076 KB |
実行使用メモリ | 16,000 KB |
最終ジャッジ日時 | 2025-01-02 02:08:46 |
合計ジャッジ時間 | 1,925 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 |
ソースコード
(define (main args)(let ([n (read)][tbl (make-hash-table)])(define (seq x)(cond [(zero? x) 1][(hash-table-exists? tbl x) (hash-table-get tbl x)][else (let ([y (+ (seq (quotient x 3)) (seq (quotient x 5)))])(hash-table-put! tbl x y)y)]))(print (seq n)))0)