結果
問題 | No.1004 サイコロの実装 (2) |
ユーザー |
![]() |
提出日時 | 2021-07-11 02:45:26 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 537 bytes |
コンパイル時間 | 112 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 6,912 KB |
最終ジャッジ日時 | 2024-07-02 02:57:48 |
合計ジャッジ時間 | 4,191 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 WA * 18 TLE * 1 -- * 13 |
ソースコード
#include<stdio.h> int main() { unsigned int a, b, x, n; scanf("%d %d %d %d", &a, &b, &x, &n); long long int c[2][2], i; c[0][0] = c[0][1] = c[1][0] = c[1][1] = 0; for (i = 0; i < (long long int)n; i++) { x = a * x + b; if (x % 6 % 2 > 0) c[0][0]++; else c[0][1]++; x = a * x + b; if (x % 6 % 2 > 0) c[1][0]++; else c[1][1]++; } if (c[0][0] < c[0][1]) printf("%d ", c[0][0]); else printf("%d ", c[0][1]); if (c[1][0] < c[1][1]) printf("%d\n", c[1][0]); else printf("%d\n", c[1][1]); return 0; }