結果

問題 No.1004 サイコロの実装 (2)
ユーザー snrnsidy
提出日時 2021-06-01 07:10:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 2,264 ms
コンパイル使用メモリ 192,704 KB
最終ジャッジ日時 2025-01-21 20:57:07
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h> 

using namespace std;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    unsigned long long int a, b, x, n;

    cin >> a >> b >> x >> n;

    unsigned long long int x0 = a * x;
    x0 %= (1LL << 32);
    x0 += b;
    x0 %= (1LL << 32);
    x0 %= 6;
    x0 += 1;
    if (x0 % 2 == 1)
    {
        cout << n / 2 << ' ' << 0 << '\n';
    }
    else
    {
        cout << 0 << ' ' << n / 2 << '\n';
    }
    
    return 0;
}
0