提出 #75419571
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define all(x) (x).begin(), (x).end()
#define pb push_back
template<class T> inline bool chmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template<class T> inline bool chmin(T& a, T b) { return a > b ? a = b, 1 : 0; }
const int MOD = 1e9 + 7;
void solve() {
int a[3][7]={0};
for(int i=0;i<3;i++){
for(int j=0;j<6;j++){
int x;cin>>x;
if(x>=1&&x<=6)a[i][x]++;
}
}
int ans=0;
ans+=a[0][4]*a[1][5]*a[2][6];
ans+=a[0][4]*a[2][5]*a[1][6];
ans+=a[1][4]*a[0][5]*a[2][6];
ans+=a[2][4]*a[0][5]*a[1][6];
ans+=a[1][4]*a[2][5]*a[0][6];
ans+=a[2][4]*a[1][5]*a[0][6];
double p=static_cast<double>(ans)/216.0 ;
cout<<fixed<<setprecision(9)<<p<<'\n';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tt = 1;
//cin>>tt;
while (tt--) {
solve();
}
return 0;
}
提出情報
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, sample_01.txt, sample_02.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| random_01.txt | AC | 1 ms | 3728 KiB |
| random_02.txt | AC | 1 ms | 3732 KiB |
| random_03.txt | AC | 1 ms | 3720 KiB |
| random_04.txt | AC | 1 ms | 3716 KiB |
| random_05.txt | AC | 1 ms | 3776 KiB |
| random_06.txt | AC | 1 ms | 3828 KiB |
| random_07.txt | AC | 1 ms | 3628 KiB |
| random_08.txt | AC | 1 ms | 3776 KiB |
| random_09.txt | AC | 1 ms | 3836 KiB |
| random_10.txt | AC | 1 ms | 3628 KiB |
| random_11.txt | AC | 1 ms | 3776 KiB |
| random_12.txt | AC | 1 ms | 3780 KiB |
| sample_01.txt | AC | 1 ms | 3680 KiB |
| sample_02.txt | AC | 1 ms | 3732 KiB |