結果
| 問題 |
No.211 素数サイコロと合成数サイコロ (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-21 21:18:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,331 bytes |
| コンパイル時間 | 736 ms |
| コンパイル使用メモリ | 88,420 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-28 15:35:38 |
| 合計ジャッジ時間 | 1,685 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <complex>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <cassert>
#include <fstream>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(a,b) for(:a<b;a++)
#define SSTR( x ) static_cast< std::ostringstream & >( \
( std::ostringstream() << std::dec << x ) ).str()
#define ALL(s) (s).begin(), (s).end()
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;
const string D_blue = "\x1b[36m";
const string D_green = "\x1b[32m";
const string D_red = "\x1b[31m";
const string D_yellow = "\x1b[33m";
const string Db_red = "\x1b[41m";
const string Db_yellow = "\x1b[43m";
const string D_end = "\x1b[39m";
const string Db_end = "\x1b[49m";
int main (){
int k;
int dice[2][6] = {{2,3,5,7,11,13},{4,6,8,9,10,12}};
while (cin >> k){
vector<int> vi;
REP(i,6){
if(k % dice[0][i] == 0){
vi.push_back(k / dice[0][i]);
}
}
int cnt = 0;
REP(i,vi.size()){
REP(j,6){
if(vi[i] == dice[1][j]){
cnt++;
}
}
}
double ans = (double)cnt / (double)36;
printf("%.13f\n" , ans);
}
return 0;
}