結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー hadrori
提出日時 2015-07-25 16:58:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 476 bytes
コンパイル時間 1,439 ms
コンパイル使用メモリ 157,912 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 22:32:12
合計ジャッジ時間 2,856 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repi(i,0,n)

const int a[] = {2,3,5,7,11,13}, b[] = {4,6,8,9,10,12};
int c[200], k;

double solve() {
    rep(i,6) rep(j,6) c[a[i]*b[j]]++;
    return 1.*c[k]/36;
}

void input() {
    cin >> k;
}

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cout << fixed << setprecision(12);
    input();
    cout << solve() << endl;
    return 0;
}
0