結果
| 問題 |
No.790 ちきんの括弧並べ
|
| ユーザー |
pasoconhoshii
|
| 提出日時 | 2019-02-20 22:22:25 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 580 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 361,312 KB |
| 最終ジャッジ日時 | 2024-11-07 19:38:34 |
| 合計ジャッジ時間 | 4,334 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 |
ソースコード
#!/mnt/c/Users/moiki/bash/env/bin/python
N = int(input())
s = [ 0 for _ in range(N+1)]
s[0] = set([""])
for i in range(1,N+1):
lst = []
for ss in s[i-1]:
lst.append("(" + ss +")")
lst.append("()"+ss)
lst.append(ss+"()")
for p in range(1,i+1): # 0 to N (i)
if s[i-p] != 0:
for ss2 in s[i-p]: # 0 to
if s[p] != 0:
for ss3 in s[p]:
lst.append( ss2 + ss3 )
lst.append( ss3 + ss2 )
s[i] = set(lst)
print(len(s[N]))
# print(s[N])
pasoconhoshii