結果

問題 No.111 あばばばば
ユーザー a_tena_ten
提出日時 2016-04-05 20:48:50
言語 Python2
(2.7.18)
結果
MLE  
実行時間 -
コード長 189 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 815,116 KB
最終ジャッジ日時 2024-04-14 22:12:52
合計ジャッジ時間 2,372 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
8,064 KB
testcase_01 AC 22 ms
8,064 KB
testcase_02 AC 23 ms
8,448 KB
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding:utf-8

from fractions import Fraction

N=input()

S='a'+'ba'*((N-1)/2)

a=S.count('a')-1
b=S.count('b')-1

cnt_a=Fraction(1,2)*a*(a+1)
cnt_b=Fraction(1,2)*b*(b+1)

print cnt_a+cnt_b
0