結果
問題 |
No.2820 Non-Preferred IUPAC Nomenclature
|
ユーザー |
|
提出日時 | 2024-07-26 22:50:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 385 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 60,444 KB |
最終ジャッジ日時 | 2024-07-26 22:50:20 |
合計ジャッジ時間 | 4,676 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | TLE * 1 -- * 21 |
ソースコード
from sys import setrecursionlimit setrecursionlimit(1<<20) def dfs(G, v, visited): visited[v] = True name = "" for u in G[v]: if not visited[u]: name += f"({dfs(G, u, visited)[:-3]}yl)" return name + "methane" 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)]))