結果
問題 | No.1004 サイコロの実装 (2) |
ユーザー |
|
提出日時 | 2020-07-13 09:41:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,177 bytes |
コンパイル時間 | 2,714 ms |
コンパイル使用メモリ | 192,424 KB |
最終ジャッジ日時 | 2025-01-11 20:12:08 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 WA * 19 TLE * 13 |
ソースコード
#include"bits/stdc++.h" using namespace std; #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++) #define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--) #define all(a) (a.begin()),(a.end()) #define rall(a) (a.rbegin()),(a.rend()) #define fi first #define se second #define pb push_back #define eb emplace_back using ll = long long; using vll = vector<ll>; using vi = vector<int>; using vvi = vector<vector<int>>; using P = pair<int, int>; void Main(){ ll a, b, x, n; cin >> a >> b >> x >> n; const ll MOD = (1LL << 32); int now = 0; int tb = 0; int tw = 0; int ab = 0; int aw = 0; rep(i, n){ int eye = a * x + b; eye %= 6; eye++; now += eye; now %= 2; if(now % 2) tb++; else tw++; eye = a * x + b; eye %= 6; eye++; now += eye; now %= 2; if(now % 2) ab++; else aw++; } cout << min(tb, tw) << " " << min(ab, aw) << endl; return; } int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(15); Main(); return 0; }