結果

問題 No.420 mod2漸化式
ユーザー 37zigen37zigen
提出日時 2016-09-10 01:17:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 3,400 ms
コンパイル使用メモリ 76,516 KB
実行使用メモリ 42,608 KB
最終ジャッジ日時 2024-04-28 06:16:27
合計ジャッジ時間 9,717 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
41,940 KB
testcase_01 WA -
testcase_02 AC 145 ms
42,152 KB
testcase_03 AC 151 ms
42,468 KB
testcase_04 AC 147 ms
42,144 KB
testcase_05 AC 147 ms
42,328 KB
testcase_06 AC 143 ms
42,060 KB
testcase_07 AC 149 ms
42,456 KB
testcase_08 AC 150 ms
42,608 KB
testcase_09 AC 137 ms
41,676 KB
testcase_10 AC 138 ms
42,024 KB
testcase_11 AC 138 ms
41,848 KB
testcase_12 AC 153 ms
42,236 KB
testcase_13 AC 143 ms
41,908 KB
testcase_14 AC 140 ms
41,824 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 152 ms
42,280 KB
testcase_20 AC 153 ms
42,348 KB
testcase_21 AC 141 ms
41,884 KB
testcase_22 AC 143 ms
41,932 KB
testcase_23 AC 136 ms
42,032 KB
testcase_24 AC 138 ms
41,720 KB
testcase_25 AC 148 ms
42,076 KB
testcase_26 AC 149 ms
42,496 KB
testcase_27 AC 138 ms
41,916 KB
testcase_28 AC 153 ms
42,312 KB
testcase_29 AC 149 ms
42,328 KB
testcase_30 AC 154 ms
42,376 KB
testcase_31 AC 150 ms
41,944 KB
testcase_32 AC 138 ms
42,056 KB
testcase_33 AC 115 ms
39,964 KB
testcase_34 AC 125 ms
41,408 KB
testcase_35 AC 112 ms
39,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package No400番台;

import java.util.Scanner;

public class Q420 {
	public static void main(String[] args) {
		new Q420().solver();
	}

	void solver() {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		if (x >= 32) {
			System.out.println(0 + " " + 0);
		} else {
			long comb = 1;
			for (int i = 31; i >= Math.max(31 - x, x) + 1; i--) {
				comb *= i;
			}
			for (int i = Math.min(31 - x, x); i >= 1; i--) {
				comb /= i;
			}
			long sum = (1L << 31) - 1;
			sum *= comb * x / 31;
			System.out.println(comb + " " + sum);
		}
	}
}
0