結果
| 問題 |
No.2820 Non-Preferred IUPAC Nomenclature
|
| コンテスト | |
| ユーザー |
ID 21712
|
| 提出日時 | 2025-04-07 16:48:34 |
| 言語 | Go (1.23.4) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 546 bytes |
| コンパイル時間 | 15,860 ms |
| コンパイル使用メモリ | 238,904 KB |
| 実行使用メモリ | 47,688 KB |
| 最終ジャッジ日時 | 2025-04-07 16:48:58 |
| 合計ジャッジ時間 | 21,484 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | AC * 1 WA * 21 |
ソースコード
package main
import . "fmt"
import . "os"
import bf "bufio"
func main() {
rd:=bf.NewReader(Stdin)
var n int
Fscan(rd,&n)
g:=make([][]int,n+1)
for i:=range g[1:] {
for j:=0;j<4;j++ {
var s string
var e int
Fscan(rd,&s)
if s=="H" {
continue
}
Sscan(s,&e)
g[i+1]=append(g[i+1],e)
}
}
v:=make([]bool,n+1)
var dfs func(x int)
dfs=func(x int) {
if v[x] {
return
}
v[x]=true
Print("(")
for _,e:=range g[x] {
dfs(e)
}
Print("methyl)")
}
for _,e:=range g[1] {
dfs(e)
}
Println("methane")
}
ID 21712