結果

問題 No.333 門松列を数え上げ
ユーザー kuromookkuromook
提出日時 2016-06-06 00:58:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-17 05:06:58
合計ジャッジ時間 1,115 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 32 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def kad_test():
	ary = range(2000000000+1)
	a,b = input().split(' ')
	a = int(a)
	b = int(b)
	flag=False
	if a>b:
		a,b = b,a
		flag = True
	l = [] if a == 1 else ary[1:a]
	m = [] if (b - a) == 1 else ary[(a+1):b]
	r = ary[(b+1):]
	#print(l)
	#print(m)
	#print(r)
	if not flag:
		print(len(l) + len(m))
	else:
		print(len(m) + len(r))
kad_test()
0