結果
| 問題 |
No.2820 Non-Preferred IUPAC Nomenclature
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-07-27 01:28:41 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 571 bytes |
| コンパイル時間 | 778 ms |
| コンパイル使用メモリ | 82,400 KB |
| 実行使用メモリ | 849,616 KB |
| 最終ジャッジ日時 | 2024-07-27 01:28:46 |
| 合計ジャッジ時間 | 4,678 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | MLE * 1 -- * 21 |
ソースコード
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2000200)
N=int(input())
C=[input().split() for i in range(N)]
USE=[0]*N
from functools import lru_cache
@lru_cache(maxsize=None)
def dfs(x):
USE[x]=1
ANS=[]
for i in range(4):
if C[x][i]=="H":
continue
k=int(C[x][i])-1
if USE[k]==1:
continue
ANS.append("(")
ANS.append("".join(dfs(k)))
ANS.append(")")
ANS.append("methyl")
#print(ANS)
return ANS
ANS=dfs(0)
ANS[-1]="methane"
print("".join(ANS))
titia