結果
問題 | No.211 素数サイコロと合成数サイコロ (1) |
ユーザー |
![]() |
提出日時 | 2016-03-27 23:40:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 821 bytes |
コンパイル時間 | 914 ms |
コンパイル使用メモリ | 83,236 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 22:51:58 |
合計ジャッジ時間 | 2,031 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
ソースコード
/* -*- coding: utf-8 -*- * * 211.cc: No.211 素数サイコロと合成数サイコロ (1) - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int pds[6] = { 2, 3, 5, 7, 11, 13 }; const int cds[6] = { 4, 6, 8, 9, 10, 12 }; /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int k; cin >> k; int cnt = 0; for (int i = 0; i < 6; i++) for (int j = 0; j < 6; j++) if (pds[i] * cds[j] == k) cnt++; printf("%.15lf\n", (double)cnt / 36); return 0; }