結果

問題 No.287 場合の数
ユーザー lip_of_cygnuslip_of_cygnus
提出日時 2015-11-07 14:43:53
言語 Python2
(2.7.18)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 632 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-04-25 12:39:04
合計ジャッジ時間 1,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
6,144 KB
testcase_01 AC 10 ms
6,144 KB
testcase_02 AC 10 ms
6,144 KB
testcase_03 AC 37 ms
6,144 KB
testcase_04 AC 38 ms
6,144 KB
testcase_05 AC 30 ms
6,144 KB
testcase_06 AC 11 ms
6,144 KB
testcase_07 AC 20 ms
6,144 KB
testcase_08 AC 22 ms
6,144 KB
testcase_09 AC 29 ms
6,144 KB
testcase_10 AC 37 ms
6,144 KB
testcase_11 AC 16 ms
6,272 KB
testcase_12 AC 33 ms
6,272 KB
testcase_13 AC 13 ms
6,144 KB
testcase_14 AC 18 ms
6,272 KB
testcase_15 AC 27 ms
6,272 KB
testcase_16 AC 21 ms
6,144 KB
testcase_17 AC 34 ms
6,144 KB
testcase_18 AC 18 ms
6,144 KB
testcase_19 AC 31 ms
6,272 KB
testcase_20 AC 21 ms
6,272 KB
testcase_21 AC 29 ms
6,144 KB
testcase_22 AC 28 ms
6,144 KB
testcase_23 AC 26 ms
6,144 KB
testcase_24 AC 21 ms
6,144 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