結果

問題 No.111 あばばばば
ユーザー kichirb3kichirb3
提出日時 2018-03-05 22:37:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 585 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 12,528 KB
最終ジャッジ日時 2023-10-11 20:34:44
合計ジャッジ時間 6,594 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,876 KB
testcase_01 AC 16 ms
7,796 KB
testcase_02 AC 25 ms
7,776 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.111 あばばばば
https://yukicoder.me/problems/no/111

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    """
    L = 9 の時、文字列は ababababa になる。この中には
    3文字の回文が (9-3+1) = 7個
    5文字の回文が (9-5+1) = 5個
    7文字の回文が (9-7+1) = 3個
    9文字の回文が (9-9+1) = 1個
    できる。
    """
    L = int(input())

    ans = 0
    for i in range(3, L+1, 2):
        ans += (L - i + 1)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
0