結果
| 問題 |
No.58 イカサマなサイコロ
|
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-26 21:19:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,188 ms / 5,000 ms |
| コード長 | 573 bytes |
| コンパイル時間 | 2,142 ms |
| コンパイル使用メモリ | 195,360 KB |
| 最終ジャッジ日時 | 2025-01-09 10:23:34 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include<bits/stdc++.h>
using lint=long long;
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
std::mt19937_64 mt{std::random_device{}()};
lint n,k;std::cin>>n>>k;
lint win=0,lose=0;
for(lint t=0;t<10'000'000;t++){
lint a=0,b=0;
for(lint i=0;i<n;i++){
a+=1+mt()%6;
}
for(lint i=0;i<n;i++){
b+=1+(i<k?mt()%3+3:mt()%6);
}
(a<b?win:lose)++;
}
std::cout<<(double)win/(win+lose)<<'\n';
}
ngtkana