結果
| 問題 |
No.1004 サイコロの実装 (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-06 23:22:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 932 bytes |
| コンパイル時間 | 805 ms |
| コンパイル使用メモリ | 79,472 KB |
| 実行使用メモリ | 13,632 KB |
| 最終ジャッジ日時 | 2024-10-14 09:52:40 |
| 合計ジャッジ時間 | 4,659 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 TLE * 1 -- * 13 |
ソースコード
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>
using namespace std;
#define int long long
#define endl "\n"
constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007;
struct fast_io {
fast_io(){
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
};
} fio;
signed main(){
cout<<fixed<<setprecision(10);
unsigned int a, b, x, N;
// int taka0 = 0, taka1 = 0, ao0 = 0, ao1 = 0, nowt = 0, nowa = 0;
int nowt = 0, nowa = 0;
int taka[2] = {}, ao[2] = {};
// vector<unsigned int> x(1);
cin>>a>>b>>x>>N;
// x.resize(N * 2+1);
for(int i = 1; i <= N * 2; i++){
x = x * a + b;
// cout<<"i = "<<i<<" "<<x[i]<<" "<<x[i]%6+1<<endl;
if(i%2) nowt += x % 6 + 1, taka[nowt%2]++;
else nowa += x % 6 + 1, ao[nowa%2]++;
}
cout<<min(taka[0], taka[1])<<" "<<min(ao[0], ao[1])<<endl;
return 0;
}