結果

問題 No.420 mod2漸化式
ユーザー maninimanini
提出日時 2016-09-11 02:01:25
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 667 bytes
コンパイル時間 2,315 ms
コンパイル使用メモリ 83,576 KB
実行使用メモリ 47,476 KB
最終ジャッジ日時 2024-04-28 10:12:16
合計ジャッジ時間 11,205 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
47,476 KB
testcase_01 WA -
testcase_02 AC 162 ms
42,396 KB
testcase_03 AC 163 ms
42,436 KB
testcase_04 AC 155 ms
42,272 KB
testcase_05 AC 165 ms
42,540 KB
testcase_06 WA -
testcase_07 AC 165 ms
42,656 KB
testcase_08 AC 151 ms
42,436 KB
testcase_09 AC 162 ms
42,312 KB
testcase_10 AC 160 ms
42,528 KB
testcase_11 AC 161 ms
42,776 KB
testcase_12 AC 147 ms
42,424 KB
testcase_13 AC 164 ms
42,672 KB
testcase_14 AC 167 ms
42,620 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 162 ms
42,432 KB
testcase_34 AC 176 ms
42,612 KB
testcase_35 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigDecimal;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long x=s.nextLong();
		
		long no=1;
		for(int i=0;i<x;i++){
			no*=31-i;
		}
		for(int i=0;i<x;i++){
			no/=x-i;
		}
		
		long no2=1;
		for(int i=0;i<x-1;i++){
			no2*=30-i;
		}
		for(int i=0;i<x-1;i++){
			no2/=(x-1)-i;
		}
		
		BigDecimal sum=new BigDecimal("0");
		for(int i=0;i<31;i++){
			long l=(long)Math.pow(2,i);
			BigDecimal lbig=new BigDecimal(l);
			sum=sum.add(lbig);
		}
		BigDecimal no2big=new BigDecimal(no2);
		sum=sum.multiply(no2big);
		System.out.println(no+" "+sum.toString());

	}
}
0