結果
問題 |
No.2820 Non-Preferred IUPAC Nomenclature
|
ユーザー |
|
提出日時 | 2024-07-26 22:47:35 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 385 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 60,192 KB |
最終ジャッジ日時 | 2024-07-26 22:47:40 |
合計ジャッジ時間 | 4,926 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | TLE * 1 -- * 21 |
ソースコード
from sys import setrecursionlimit setrecursionlimit(1<<20) def dfs(G, v, visited): visited[v] = True name = "methane" for u in G[v]: if not visited[u]: name = f"({dfs(G, u, visited)[:-3]}yl){name}" return name N = int(input()) C = [[int(c)-1 for c in input().split() if c.isdigit()] for i in range(N)] print(dfs(C, 0, [False for i in range(N)]))