結果
問題 |
No.1004 サイコロの実装 (2)
|
ユーザー |
|
提出日時 | 2020-03-06 23:28:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 482 bytes |
コンパイル時間 | 461 ms |
コンパイル使用メモリ | 55,608 KB |
実行使用メモリ | 13,632 KB |
最終ジャッジ日時 | 2024-10-14 09:54:51 |
合計ジャッジ時間 | 4,359 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 TLE * 1 -- * 13 |
ソースコード
#include <iostream> using namespace std; int main(){ unsigned int a,b,x,N; cin >> a >> b >> x >> N; unsigned int takaB=0,takaW=0,aokiB=0,aokiW=0; int takaP=0,aokiP=0; for(int i=0;i<N;i++){ x=a*x+b; takaP+=x%6+1; if(takaP%2==0)takaW++; else takaB++; x=a*x+b; aokiP+=x%6+1; if(aokiP%2==0)aokiW++; else aokiB++; } cout << min(takaB,takaW) << " "<< min(aokiB,aokiW) <<endl; return 0; }