結果
問題 | No.58 イカサマなサイコロ |
ユーザー |
![]() |
提出日時 | 2016-02-28 02:55:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 426 bytes |
コンパイル時間 | 466 ms |
コンパイル使用メモリ | 56,540 KB |
実行使用メモリ | 10,140 KB |
最終ジャッジ日時 | 2024-09-24 12:00:05 |
合計ジャッジ時間 | 10,233 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 TLE * 1 -- * 8 |
ソースコード
#include<iostream> #include<cstdio> #include<cstdlib> using namespace std; int main(){ srand(2); int xi[]={1,2,3,4,5,6}; int ixi[]={4,5,6,4,5,6}; int N,K; int tw=0,zw=0; int i=0; cin>>N>>K; while(i<20000000){ int tp=0,zp=0; for(int i=0;i<N;i++){ if(i<K) tp+=ixi[rand()%6]; else tp+=xi[rand()%6]; zp+=xi[rand()%6]; } if(tp>zp) tw++; else zw++; i++; } printf("%.3f\n",(double)tw/(tw+zw)); }