結果

問題 No.790 ちきんの括弧並べ
ユーザー phtmscg
提出日時 2019-04-04 00:57:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 328 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-12-23 16:29:50
合計ジャッジ時間 5,378 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
c = 0

def bracket(s):
    sl = s.count("(")
    sr = s.count(")")
    if sl == sr and sl != N and sr != N:
        bracket(s+"(")
    elif sl != N and sr != N:
        bracket(s+"(")
        bracket(s+")")
    elif sr != N:
        bracket(s+")")
    else:
        global c
        c += 1
bracket("(")
print(c)
0