結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー RinRin
提出日時 2015-09-04 17:07:23
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 20 ms / 1,000 ms
コード長 728 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 12,032 KB
最終ジャッジ日時 2023-09-08 05:21:11
合計ジャッジ時間 2,294 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,652 KB
testcase_01 AC 19 ms
11,716 KB
testcase_02 AC 17 ms
11,864 KB
testcase_03 AC 18 ms
11,868 KB
testcase_04 AC 17 ms
11,804 KB
testcase_05 AC 17 ms
11,944 KB
testcase_06 AC 16 ms
11,568 KB
testcase_07 AC 17 ms
11,648 KB
testcase_08 AC 17 ms
12,032 KB
testcase_09 AC 20 ms
11,720 KB
testcase_10 AC 17 ms
11,636 KB
testcase_11 AC 18 ms
12,020 KB
testcase_12 AC 18 ms
11,612 KB
testcase_13 AC 18 ms
11,652 KB
testcase_14 AC 19 ms
11,820 KB
testcase_15 AC 19 ms
11,840 KB
testcase_16 AC 19 ms
11,644 KB
testcase_17 AC 20 ms
11,896 KB
testcase_18 AC 19 ms
11,912 KB
testcase_19 AC 20 ms
11,564 KB
testcase_20 AC 18 ms
11,812 KB
testcase_21 AC 20 ms
11,724 KB
testcase_22 AC 19 ms
11,576 KB
testcase_23 AC 20 ms
11,912 KB
testcase_24 AC 20 ms
11,736 KB
testcase_25 AC 20 ms
11,620 KB
testcase_26 AC 20 ms
11,648 KB
testcase_27 AC 20 ms
11,648 KB
testcase_28 AC 19 ms
11,648 KB
testcase_29 AC 19 ms
11,752 KB
testcase_30 AC 19 ms
11,844 KB
testcase_31 AC 18 ms
11,820 KB
testcase_32 AC 20 ms
11,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (System.out.println x)
  (begin
    (display x)
    (newline)
  )
)

(define foo
  (let loop(
            (i 0)
            (j 0)
            (prime (list 2 3 5 7 11 13))
            (comp  (list 4 6 8 9 10 12))
            (ls '())
           )
    (if (= i 6)
        ls
        (loop (+ i (floor (/ j 5))) (modulo (+ j 1) 6) prime comp (cons (* (list-ref prime i) (list-ref comp j)) ls))
    )
  )
)

(define (CntCase x)
  (let loop(
            (i 0)
            (Matched 0)
           )
    (if (= i 36)
        Matched
        (if (= x (list-ref foo i))
            (loop (+ i 1) (+ Matched 1))
            (loop (+ i 1) Matched)
        )
    )
  )
)

(System.out.println (exact->inexact (/ (CntCase (read)) 36)))
0