結果

問題 No.1004 サイコロの実装 (2)
ユーザー ks2mks2m
提出日時 2020-03-06 22:40:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 2,300 ms
コンパイル使用メモリ 77,036 KB
実行使用メモリ 54,728 KB
最終ジャッジ日時 2024-04-22 09:50:02
合計ジャッジ時間 9,765 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
41,592 KB
testcase_01 AC 153 ms
41,652 KB
testcase_02 AC 152 ms
41,460 KB
testcase_03 AC 153 ms
41,644 KB
testcase_04 AC 156 ms
41,992 KB
testcase_05 AC 153 ms
41,928 KB
testcase_06 AC 175 ms
41,888 KB
testcase_07 AC 155 ms
41,860 KB
testcase_08 AC 155 ms
41,976 KB
testcase_09 AC 151 ms
41,500 KB
testcase_10 AC 154 ms
41,524 KB
testcase_11 WA -
testcase_12 AC 156 ms
41,444 KB
testcase_13 AC 156 ms
41,616 KB
testcase_14 AC 156 ms
41,348 KB
testcase_15 AC 153 ms
41,588 KB
testcase_16 AC 152 ms
41,496 KB
testcase_17 AC 155 ms
41,580 KB
testcase_18 AC 158 ms
41,756 KB
testcase_19 AC 157 ms
41,532 KB
testcase_20 AC 158 ms
41,584 KB
testcase_21 AC 156 ms
41,404 KB
testcase_22 AC 153 ms
41,588 KB
testcase_23 AC 156 ms
41,628 KB
testcase_24 AC 154 ms
41,492 KB
testcase_25 AC 156 ms
41,992 KB
testcase_26 AC 155 ms
41,972 KB
testcase_27 AC 153 ms
40,444 KB
testcase_28 AC 152 ms
41,564 KB
testcase_29 AC 176 ms
41,388 KB
testcase_30 AC 151 ms
41,848 KB
testcase_31 AC 154 ms
41,888 KB
testcase_32 AC 154 ms
41,848 KB
testcase_33 AC 154 ms
41,532 KB
testcase_34 WA -
testcase_35 AC 155 ms
41,496 KB
testcase_36 AC 155 ms
41,816 KB
testcase_37 AC 154 ms
41,364 KB
testcase_38 AC 153 ms
41,644 KB
testcase_39 AC 152 ms
41,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long[] x = new long[7];
		x[0] = sc.nextLong();
		long n = sc.nextLong();
		sc.close();

		long m = 1L << 32;
		for (int i = 1; i < x.length; i++) {
			x[i] = a * x[i - 1] % m + b;
			x[i] %= m;
		}
		for (int i = 1; i < x.length; i++) {
			x[i]++;
		}

		if (x[1] % 2 == 1) {
			System.out.println(n / 2 + " 0");
		} else {
			System.out.println("0 " + n / 2);
		}
	}
}
0