結果
| 問題 |
No.2301 Namorientation
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2023-05-14 09:42:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,860 ms / 3,000 ms |
| コード長 | 426 bytes |
| コンパイル時間 | 202 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 100,224 KB |
| 最終ジャッジ日時 | 2024-11-29 23:42:40 |
| 合計ジャッジ時間 | 36,410 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
I,J,R=input,int,range
N=J(I())
M=R(N)
E,V=[[] for n in M],[set() for n in M]
for n in M:
X=I().split()
E[n]=[J(X[0])-1,J(X[1])-1,0]
for i in R(2):V[E[n][i]].add(n)
for n in M:
v=n
while len(V[v])==1:
e=V[v].pop()
i=v==E[e][0]
w,E[e][2]=E[e][i],i
V[w].remove(e)
v=w
for v in M:
while len(V[v]):
e=V[v].pop()
i=v==E[e][0]
w,E[e][2]=E[e][i],i
V[w].remove(e)
v=w
for n in M:print("->"if E[n][2] else"<-")