結果

問題 No.432 占い(Easy)
ユーザー neko_the_shadowneko_the_shadow
提出日時 2016-10-16 21:53:36
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2024-05-02 02:41:38
合計ジャッジ時間 3,233 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
16,000 KB
testcase_01 AC 27 ms
15,872 KB
testcase_02 AC 27 ms
15,872 KB
testcase_03 AC 28 ms
16,128 KB
testcase_04 AC 29 ms
16,384 KB
testcase_05 WA -
testcase_06 AC 27 ms
16,000 KB
testcase_07 AC 30 ms
16,384 KB
testcase_08 AC 27 ms
16,128 KB
testcase_09 AC 28 ms
16,256 KB
testcase_10 WA -
testcase_11 AC 63 ms
19,840 KB
testcase_12 AC 373 ms
20,736 KB
testcase_13 AC 369 ms
20,736 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 27 ms
15,872 KB
testcase_18 AC 198 ms
20,736 KB
testcase_19 AC 144 ms
20,736 KB
testcase_20 AC 82 ms
20,736 KB
testcase_21 AC 89 ms
20,864 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 28 ms
16,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (digits x)
  (let loop ((n x) (ls '()))
    (if (< n 10)
      (cons n ls)
      (loop (quotient n 10) 
            (cons (modulo n 10) ls)))))

(define (f ls)
  (if (= 1 (length ls))
    (car ls)
    (f (map (lambda (x y) (+  (modulo   (+ x y) 10)
                              (quotient (+ x y) 10)))
            (cdr ls)
            ls))))

(define (input->list)
  (let loop ((line (read)) (ls '()))
    (if (eof-object? line)
      (cdr (reverse ls))
      (loop (read) (cons line ls)))))

(define (MAIN)
  (for-each
    (lambda (ans) (begin (display ans) (newline)))
    (map (lambda (x) (f (digits x))) (input->list))))

(MAIN)
0