結果
| 問題 |
No.211 素数サイコロと合成数サイコロ (1)
|
| コンテスト | |
| ユーザー |
gemy
|
| 提出日時 | 2023-11-21 01:45:13 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 425 bytes |
| コンパイル時間 | 1,870 ms |
| コンパイル使用メモリ | 193,036 KB |
| 最終ジャッジ日時 | 2025-02-17 22:38:49 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
// Input
int K;
cin >> K;
// Calculate
int ans = 0;
int p[6] = {2, 3, 5, 7, 11, 13};
int c[6] = {4, 6, 8, 9, 10, 12};
rep(i, 6) rep(j, 6) if (p[i] * c[j] == K) ++ans;
// Output
cout << fixed << setprecision(20);
cout << ans / 36.0 << endl;
}
gemy