結果

問題 No.287 場合の数
ユーザー lip_of_cygnuslip_of_cygnus
提出日時 2015-11-07 14:43:53
言語 Python2
(2.7.18)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 632 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 6,720 KB
実行使用メモリ 6,088 KB
最終ジャッジ日時 2023-08-07 19:05:54
合計ジャッジ時間 2,303 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
5,888 KB
testcase_01 AC 11 ms
5,840 KB
testcase_02 AC 11 ms
5,848 KB
testcase_03 AC 39 ms
5,940 KB
testcase_04 AC 38 ms
5,888 KB
testcase_05 AC 31 ms
5,924 KB
testcase_06 AC 12 ms
5,920 KB
testcase_07 AC 19 ms
5,836 KB
testcase_08 AC 25 ms
5,848 KB
testcase_09 AC 31 ms
6,012 KB
testcase_10 AC 40 ms
6,012 KB
testcase_11 AC 17 ms
5,972 KB
testcase_12 AC 36 ms
5,904 KB
testcase_13 AC 14 ms
6,088 KB
testcase_14 AC 21 ms
5,924 KB
testcase_15 AC 30 ms
6,052 KB
testcase_16 AC 22 ms
6,080 KB
testcase_17 AC 34 ms
5,888 KB
testcase_18 AC 20 ms
5,908 KB
testcase_19 AC 33 ms
5,948 KB
testcase_20 AC 23 ms
5,884 KB
testcase_21 AC 31 ms
5,976 KB
testcase_22 AC 30 ms
5,944 KB
testcase_23 AC 27 ms
6,052 KB
testcase_24 AC 21 ms
5,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

n=int(raw_input())
a=[[0] * 2 for i in range(3)]  #a=[[0] * x for i in range(y)]で、a[y-1][x-1]までできる。
def kosu2(i,n):
	if i>=n:
		 k=2*n+1-i
	else:
		k=i+1
	return k

def kosu4(i,n):
	l=0
	for x in range (0,2*n+1):
		if x>2*n or i-x<0:
			break		
		if 0<=x and x<= 2*n and 0<=i-x and i-x <= 2*n:
			l=l+kosu2(x,n)*kosu2(i-x,n)
		x=x+1	
	return l
def kosu8(n):
	l=0
	for x in range (2*n,4*n+1):
		if x>4*n:
			break		
		l=l+kosu4(x,n)*kosu4(6*n-x,n)
		x=x+1	
	return l

print kosu8(n)
'''
2211から

6*n


16 16 16 00000
6 0 0
5 1 0
4  2 0
4 1 1
3 2 1

//
'''
0