-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add permutation tree #745
add permutation tree #745
Conversation
現状問題文がかなり説明不足な気がします。 |
大分時間がたってしまいましたが、問題文を書きました。 |
[問題文]
とか
とか。 ・順列 P のあとに余分なピリオド [en] [問題名] |
ご指摘いただいた点直しました! |
@{lang.ja} | ||
長さ $N$ の順列 $P_0, P_1, \cdots, P_{N-1}$ が与えられる。この順列に対応する **common interval decomposition tree** を出力せよ。ただし、本問において下記の様に語句を定義する。 | ||
|
||
- **interval** は ある整数 $l$,$r$ に対して、$\lbrace i\in \mathbb{Z}\ |\ 0 \leq l \leq i \leq r <N \rbrace $ と表せる集合とする。この様な **interval** を **interval** $\[l, r\]$ と表す。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
空集合(例: l = 100, r = 0)がintervalなのかわかりにくい気がします(空集合はintervalではないですよね?)。
... ある整数
とかでしょうか
|
||
- **interval** は ある整数 $l$,$r$ に対して、$\lbrace i\in \mathbb{Z}\ |\ 0 \leq l \leq i \leq r <N \rbrace $ と表せる集合とする。この様な **interval** を **interval** $\[l, r\]$ と表す。 | ||
- **connected interval** は **interval** $\[l, r\]$ であって $\lbrace P_i\ |\ l \leq i \leq r\rbrace$ もまた **interval** となるものである。 | ||
- **connected interval** $I$ が **strong interval** であるとは、任意の **connected interval** $J$ に対して $I \subset J$ , $J \subset I$ , $I \cap J =\emptyset$ のいずれかが成り立つことをいう。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重箱の隅ですが、他の行が "(新しい単語) は ... である" なのにこの行だけ違って少しアレなんで、
strong interval とは、connected interval
はどうでしょう
$X$ is the number of vertices in the **common interval decomposition tree**. $\[l_i,r_i\]$ is the **interval** corresponding to the $i$-th vertex, and $S_i$ is "linear" if the $i$-th vertex is a **linear node** or "prime" if it is a **prime node**. However, the order of the vertices is the preoder of the children in ascending order of the left end $l$. | ||
|
||
@{lang.ja} | ||
$X$ は **common interval decomposition tree** の頂点数。$\[l_i,r_i\]$ は $i$ 番目の頂点に対応する **interval** とし、$S_i$ は $i$ 番目の頂点が **linear node** なら "linear" 、**prime node** なら "prime"。ただし、頂点の順番は子を左端 $l$ の昇順に並べた際の preoder。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preorderを出力はなんか特殊な気がします
X
p l r S
p l r S
:
p l r S
p l r S
みたいな形式でノードの親(or = -1)を出力させるやつのほうがいい気がしますが どうでしょうか(custom checkerを用意する必要がありますが
for (int i = 0; i < N; ++i) { | ||
if (i) | ||
inf.readSpace(); | ||
int c = inf.readInt(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inf.readInt(0, N - 1)
ありがとうございます! いくつかコメントしましたが全体的に良さそうです 問題文も厳密になっていて、いい感じです |
基本的にこのジャッジ半開区間なんですが、さすがにこの問題は閉区間のほうが自然な気がしていて、悩みどころ |
ごめんなさい、まだチェッカー作れてませんでした。今のままだとpreorderしかACにならない状態なので、可能なら戻して欲しいです。 |
提出も大した量出ないと思うので新規でissue立てて早めにプルリク送る形にしようと思います。 |
close #744