結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー tnoda_
提出日時 2015-07-16 01:08:15
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 825 bytes
コンパイル時間 711 ms
コンパイル使用メモリ 85,124 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 22:30:04
合計ジャッジ時間 1,533 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <numeric>
#include <functional>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()

using namespace std;
typedef long long ll;

int main(int argc, char *argv[])
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  int K, x = 0, p[6] = {2, 3, 5, 7, 11, 13}, c[6] = {4, 6, 8, 9, 10, 12};

  cin >> K;
  REP(i,6) REP(j,6) if (p[i]*c[j] == K) x++;
  cout << fixed << setprecision(13) << x / 36.0 << endl;
  
  return 0;
}
0