結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー SotaUN
提出日時 2020-11-02 20:55:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 604 bytes
コンパイル時間 824 ms
コンパイル使用メモリ 93,832 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-22 08:01:42
合計ジャッジ時間 1,752 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
    ll n;
    cin >> n;
    vector<ll> a = {2,3,5,7,11,13};
    vector<ll> b = {4,6,8,9,10,12};
    double k = 0;
    for(int i = 0;i < 6;i++){
        for(int j = 0;j < 6;j++){
            if(a[i] * b[j] == n)k++;
          //cout << a[i] << " " << b[j] << endl;
        }
    }
    double res = (double)(k / 36);
    cout << fixed << setprecision(20) << res << endl;
}
0