結果
| 問題 |
No.2301 Namorientation
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2023-05-14 09:18:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 435 bytes |
| コンパイル時間 | 125 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 100,224 KB |
| 最終ジャッジ日時 | 2024-11-29 23:29:22 |
| 合計ジャッジ時間 | 26,001 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 4 RE * 18 |
ソースコード
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])<2:
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])>0:
e=V[v].pop()
i=v==E[e][0]
w,E[e][2]=E[e][i],i
V[w].remove(e)
v=w
break
for n in M:print("->"if E[n][2] else"<-")