結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー neko_the_shadowneko_the_shadow
提出日時 2019-05-23 17:37:33
言語 Bash
(Bash 5.1.16)
結果
WA  
実行時間 -
コード長 411 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 11:31:31
合計ジャッジ時間 2,004 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,348 KB
testcase_01 AC 3 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 3 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 3 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 3 ms
4,348 KB
testcase_15 AC 3 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 3 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 3 ms
4,348 KB
testcase_25 AC 3 ms
4,348 KB
testcase_26 AC 3 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 2 ms
4,348 KB
testcase_30 AC 3 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/bin/bash

read k
awk -v k=${k} 'BEGIN {
  dice1[1] = 4
  dice1[2] = 6
  dice1[3] = 8
  dice1[4] = 9
  dice1[5] = 10
  dice1[6] = 12

  dice2[1] = 2
  dice2[2] = 3
  dice2[3] = 5
  dice2[4] = 7
  dice2[5] = 11
  dice2[6] = 13

  x = 0
  y = 0
  for (i = 1; i <= length(dice1); i++) {
    for (j = 1; j <= length(dice2); j++) {
      x += 1
      if (dice1[i] * dice2[j] == k) y += 1
    }
  }
  print y / x
}'
0