結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
8,192 KB
testcase_01 AC 22 ms
7,936 KB
testcase_02 AC 23 ms
8,576 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