結果

問題 No.1004 サイコロの実装 (2)
ユーザー 37zigen37zigen
提出日時 2020-03-06 18:51:29
言語 Java19
(openjdk 21)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 632 bytes
コンパイル時間 4,416 ms
コンパイル使用メモリ 73,708 KB
実行使用メモリ 56,316 KB
最終ジャッジ日時 2023-08-04 05:57:27
合計ジャッジ時間 11,978 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
55,984 KB
testcase_01 AC 143 ms
55,876 KB
testcase_02 AC 142 ms
56,136 KB
testcase_03 AC 143 ms
55,936 KB
testcase_04 AC 142 ms
56,040 KB
testcase_05 AC 142 ms
55,872 KB
testcase_06 AC 142 ms
55,924 KB
testcase_07 AC 144 ms
55,868 KB
testcase_08 AC 150 ms
55,992 KB
testcase_09 AC 145 ms
55,912 KB
testcase_10 AC 143 ms
55,876 KB
testcase_11 AC 146 ms
55,900 KB
testcase_12 AC 145 ms
56,040 KB
testcase_13 AC 145 ms
55,964 KB
testcase_14 AC 147 ms
56,012 KB
testcase_15 AC 145 ms
54,196 KB
testcase_16 AC 144 ms
56,076 KB
testcase_17 AC 143 ms
56,008 KB
testcase_18 AC 144 ms
55,844 KB
testcase_19 AC 143 ms
55,736 KB
testcase_20 AC 143 ms
56,128 KB
testcase_21 AC 143 ms
55,756 KB
testcase_22 AC 143 ms
55,868 KB
testcase_23 AC 144 ms
56,316 KB
testcase_24 AC 142 ms
56,200 KB
testcase_25 AC 142 ms
55,748 KB
testcase_26 AC 144 ms
55,524 KB
testcase_27 AC 145 ms
55,520 KB
testcase_28 AC 143 ms
56,068 KB
testcase_29 AC 144 ms
55,768 KB
testcase_30 AC 153 ms
55,820 KB
testcase_31 AC 148 ms
55,520 KB
testcase_32 AC 148 ms
56,056 KB
testcase_33 AC 144 ms
55,840 KB
testcase_34 AC 144 ms
55,752 KB
testcase_35 AC 144 ms
56,092 KB
testcase_36 AC 143 ms
56,044 KB
testcase_37 AC 144 ms
55,920 KB
testcase_38 AC 145 ms
55,872 KB
testcase_39 AC 145 ms
56,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 制約の確認

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		long b=sc.nextLong();
		long x0=sc.nextLong();
		long N=sc.nextLong();
		if(!(0<=a&&0<=b&&0<=x0&&0<=N&&a<(1L<<32)&&b<(1L<<32)&&x0<(1L<<32)&&N<(1L<<32)))throw new AssertionError();
		if(!(a%4==1&&b%2==1))throw new AssertionError();
		long x1=(a*x0+b)%6+1;
		System.out.println(x1%2==0?(0+" "+N/2):(N/2+" "+0));
	}
	
	void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}
0