結果

問題 No.420 mod2漸化式
ユーザー tsuchinagatsuchinaga
提出日時 2019-05-17 09:02:08
言語 Go
(1.21.3)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 416 bytes
コンパイル時間 12,914 ms
コンパイル使用メモリ 212,536 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 07:10:43
合計ジャッジ時間 21,069 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 933 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 5 ms
4,348 KB
testcase_09 AC 14 ms
4,348 KB
testcase_10 AC 37 ms
4,348 KB
testcase_11 AC 87 ms
4,348 KB
testcase_12 AC 183 ms
4,348 KB
testcase_13 AC 336 ms
4,348 KB
testcase_14 AC 539 ms
4,348 KB
testcase_15 AC 757 ms
4,348 KB
testcase_16 AC 933 ms
4,348 KB
testcase_17 TLE -
testcase_18 AC 964 ms
4,348 KB
testcase_19 AC 807 ms
4,348 KB
testcase_20 AC 592 ms
4,348 KB
testcase_21 AC 380 ms
4,348 KB
testcase_22 AC 214 ms
4,348 KB
testcase_23 AC 105 ms
4,348 KB
testcase_24 AC 45 ms
4,348 KB
testcase_25 AC 17 ms
4,348 KB
testcase_26 AC 6 ms
4,348 KB
testcase_27 AC 3 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 1 ms
4,348 KB
testcase_31 AC 1 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 1 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"math"
)

func main() {
	var x int
	_, _ = fmt.Scan(&x)

	if x == 0 {
		fmt.Println("1 0")
	} else if x > 31 {
		fmt.Println("0 0")
	} else {
		fmt.Printf("%d %d\n", comb420(31, x), (int(math.Pow(2, 31))-1)*comb420(30, x-1))
	}
}

func comb420(l, r int) int {
	if r == 0 || l == r {
		return 1
	} else if r == 1 {
		return l
	} else {
		return comb420(l-1, r-1) + comb420(l-1, r)
	}
}
0